Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is awesome! :D
it's fantastic. Thank you!
Expected and actual values are inverted in the tests, you're returning str when n is 0 with your code.
If you look at the top of the kata, you will see that it says, "Postgresql 9.6" or something similar. That tells you the specific version of SQL being used for this kata. Search online for the appropriate function to use for postgresql. It's similar to hex().
If you look at the top of the kata, you will see that it says, "Postgresql 9.6" or something similar. That tells you the specific version of SQL being used for this kata. Search online for the appropriate function to use for postgresql. It's similar to hex().
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
There is only one such test case in the fixed tests and its set to
false
which is expected. It might appear in random tests sometimes and if you gettrue
from it, then the problem is with your code. So i suggest you check your code. :)Consider this array:
Array
(
[0] => 3
[1] => 1
[2] => 2
[3] => 3
[4] => 0
)
It keeps repeating in various tests, and it is marked as true in one test (edge cases), while it is marked as false in random tests. Also, is this array really a Madhav array? I'm guessing it's not, since it should have 6 elements. That is, there's no a[5], and there's no way that we would have:
a[0] = a[1] + a[2] = a[3] + a[4] + a[5]
Isn't one of the prerequisites for a Madhav array that it has 3, 6, 10, 15, etc elements, and only that many, not one more or less? The sums check out, but the number of addends does not.
This comment is hidden because it contains spoiler information about the solution