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.
OP solved it, closing
OP solved it, closing
Not a kata issue, you use a var with the same name as the function. Use
let
to keep the scope (and probably it's not a best practice to name two different things the same).clever
Yes, you run out of cards, you lose. The winner is the player that ends up with all the cards.
for the rest of the test cases did you TLE? because seems like the parts that go "array[a][b] not in res" is going to be O(n-squared) time complexity due to searching through the whole array every time you try to put something in.
if its TLE, try to think of a faster algo?
Good first step is to reproduce failing test cases locally and debug them in your IDE: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#how-can-i-see-which-input-causes-my-solution-to-fail
the shape isn't the only problem. I guess you should read a bit more about sudokus. Maybe solve some by hand too.
Your append fails in this case:
No, you don't always pick the highest number, otherwise you might end up on side with lower numbers and won't be able to reach bigger numbers later on.
It'll sound obvious, but find the algorithm which is 100% accurate.