fixed day 7
This commit is contained in:
@@ -38,7 +38,7 @@ internal class BridgeRepair : Problem<ulong, ulong>
|
|||||||
|
|
||||||
private static bool IsSolvable(ulong target, ulong[] nums, Operator curOperator, ulong curTotal, Operator[] ops, int idx = 1)
|
private static bool IsSolvable(ulong target, ulong[] nums, Operator curOperator, ulong curTotal, Operator[] ops, int idx = 1)
|
||||||
{
|
{
|
||||||
if (target == curTotal)
|
if (target == curTotal && idx == nums.Length)
|
||||||
return true;
|
return true;
|
||||||
if (curTotal > target)
|
if (curTotal > target)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user