• ###### Adamantishcommented on "IQ Test" ruby solution

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "IQ Test" ruby solution

Damn I love this! (wouldn't actually want it in a codebase at work without comments but still).
For anyone confused here's the implicit reasoning:
If sieve is [false, false, true, false] then the even number marked by true is the one to pick out.
We can detect this with sieve.count(true) < 2

The neat thing is that the answer to this boolean is the same as the actual value we want to get the position of in the array. If it's true then we're looking for the one true, if not then it's the only false.

• ###### Adamantishcommented on "Bouncing Balls" go solution

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "Find the smallest" ruby solution

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "Find the smallest" kata

Am I understanding this test behaviour correctly on the ruby version?
Expected output from random test: [37476679391174395, 0, 7]
I understand this to mean that the input number was 93747667391174395 and the 9 was moved from the front to the 7th position.
But if we move that 9 to the last position we get a smaller number.

• ###### Adamantishcommented on "Find the smallest" kata

Chrono79, as you say `i` must be as small as possible. But it also says the same about `j` with no statement about which should take precedence. In the case of `0, 1` it could also be done as `1, 0` with the same effect (and this would be the simpler way too). I might have misunderstood but it seems for the `0, 1` case to make sense another explicit rule would need to be in the text.

• ###### Adamantishcommented on "All I need's a platform, man!" javascript solution

Very succinct and uses syntax this noob is unfamiliar with. But it doesn't use platformLimit to optimize.

• ###### Adamantishcommented on "Recover a secret string from random triplets" kata

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "Double Cola" javascript solution

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "All I need's a platform, man!" javascript solution

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "Paul's study plan" kata

This comment is hidden because it contains spoiler information about the solution

• ###### Adamantishcommented on "Holiday Array Repair" kata

Oh and if it's going to supply them with example test cases why not do one for "not possible" for the sake of completeness

• ###### Adamantishcommented on "Holiday Array Repair" kata

Nice little problem for teaching fundamentals and well explained.
Some feedback/questions:

• Doesn't appear to test for integers, rather it tests for numbers of every kind. ZozoFouchtra's answer is one of the few that would pass
• The last test case supplies something that isn't an array. The question says they'll always be arrays.
• To encourage good practice it would be better to return in only one datatype i.e. false could be "Liar" and true become "Honest". Javascript allows this mixing of return types unlike other languages but taking advantage of that can lead to a lot of trouble and should be done for a really good reason.