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.
Beautiful :)
The tests seem broken for C. The parameter tree_size isn't passed correctly.
If I print the value of tree_size, which should be 8 for the first test case, I get zero. This means that I get a result array of size zero and fail the test case.
But if I manually assign the value 8 to it, I pass the test case.
This comment is hidden because it contains spoiler information about the solution
The first one.
4 (2+avg 10 30) = 13.0
Sure, I understand that's a decision that's been made, but I really don't share that view.
Imo this is a 4 kyu in python, but a 3 kyu in c or java if one insists on finding the shortest path.
To be fair, I think it's strange to maintain the same kyu for different programming languages in cases like these.
Also, the description shoud clearly state that there could be more than one exit.
Time complexity is O(n). The image is scanned two times at most.
Thanks for the feedback. The code wasn't efficient and I did a lot of unnecessary work. I optimized it, and now it works fine. Nice kata :)
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 comment is hidden because it contains spoiler information about the solution
Interestingly, I get this solution due to the heuristic that I used:
A challenge version someone? :)
Took some time, but it was a fun challenge. Thanks :)
Not sure what happend then, because I just copied it. Perhaps I copied it wrong.
But if it's OK on your side, then it's all good :D
Cheers!
Loading more items...