Day 7, remove useless braces

This commit is contained in:
nazrin 2024-12-08 23:58:11 +00:00
parent 98276d0854
commit 27631b5043

2
7.jl
View file

@ -8,7 +8,7 @@ for (target,nums) in Iterators.peel.(equations)
nums = collect(nums)
function testCase(funcs::Tuple, p = 1, sum = 0)::Bool
if p > length(nums)
return (sum == target)
return sum == target
end
return any(testCase(funcs, p+1, fn(sum, nums[p])) for fn in funcs)
end