You must say in the description that each solution [x, y, z] has to be sorted in decreasing order.
For example, the solution [13, 26, 13] has to be returned as [26, 13, 13]. I had to guess this...
Edit: However, I think it would be better to just keep the [x, y, z] order instead.
no longer relevant
I'm really embarrassed to have missed this elegant solution! 🤦😭
Interesting that [].all? 1 == true
You must say in the description that each solution
[x, y, z]
has to be sorted in decreasing order.For example, the solution
[13, 26, 13]
has to be returned as[26, 13, 13]
. I had to guess this...Edit: However, I think it would be better to just keep the
[x, y, z]
order instead.A kata don't have to be only implementation, it can be about thinking too.
Both sets of random tests use
(expt n 2)
and thus are essentially the same.ng
accepts nil as false.