You are absolutely right! Removed redundant check and solution is now valid.
Thank you, sir!

On Monday, January 13, 2020 at 11:21:35 PM UTC+2, Xiongqi ZHANG wrote:
>
> Took me a while to debug since I am not familiar with Ruby at all.
>
> For some reason, res.sum is not supported.
>
> Removing `res.sum == amount &&` from valid_res?(res, amount) resolve the 
> problem
>
> Also you don't need to do that check because it is always true anyway.
> Also res[i] will never be 4, so the `if res[1] == 4` block will never be 
> run anyway.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/6cffa495-5d7a-48f0-b98b-e72ad6ecd986%40googlegroups.com.

Reply via email to