This shouldn't pass, but it passes.
The reference code in the description is missing the JS version.
Python: The sorting requirement in the description and in the tests don't match.
As described, the example output gets the second and third rectangles wrong (the second has a width of 2, the third a width of 1; the latter should come first as it shares a top left corner with the second but has a smaller width)
[(1, 1), (1, 2)],
[(2, 2), (2, 3)],
[(2, 2), (3, 2)]
The tests expect the output to simply be sorted lexicographically, i.e. without any special key function at all. This matches the output described above.
The description should have this requirement removed for Python (don't know about Haskell tests).
It's a pretty interesting kata and unique, that's for sure. The problem is that the description is quite confusing. You should provide some details about how the function should work, that would be much easier to make some tests, that would prove that the implementation is wrong.
Also, in C# tests break, when I call function with null as a parameter, I think you should probably look into that, because the first parameters, that would come to my mind when testing using string as paarameter is string.Empty and null.
This comment is hidden because it contains spoiler information about the solution
I think that BigInteger would be preferred, since the result is expected to be a number. The fact that its decimal form has some interesting pattern and it happens to be convenient to be processed as string is just an implementation detail.
Random tests are incorrect, my solution sometimes passes, and sometimes fails.
In Java version:
Great catch. All are corrected. Could you help bring it out of beta? Thanks a lot!
Java: the function name should be in camelCase: missingNumber.
The maximum tested value should be changed to 500 in Java (it is 299 now).
The expected value should be the first argument of assertEquals in random tests.
Hi, This beta kata is now "Awaiting moderator approval". Is your ranking high enough to be a moderator? Could you help approve it? Thanks.