My solution only passes if I cast $Sum - $a - $b
to [int]
at line 67. I don’t understand this since $a
, $b
, and $Sum
are all integers.
You dont need to cast [int]
at all, I copy and pasted your solution without the cast and it passed.
You however do need to eval $Sum - $a - $b
with parentheses though, or else powershell will read @($a, $b, $Sum - $a - $b)
as @($a, $b, $Sum) - $a - $b
and give a [System.Object[]] does not contain a method named 'op_Subtraction'
error.
Thanks, @glaxxie . I keep on forgetting that the order of precedence with respect to ,
is different than all other languages I know.