May I know why this is the case? Why does the checker take so long to fail short arrays (by default)? This is no longer an issue, but it still can't fail [[1]] in time.
The "dictionary" and the "adjacency list" are quite similar in structure, and one of them should be taken out as a redundant test case. The kata should be testing the conversion of "edge list" instead of "adjacency list".
Yes, apologies.
This comment is hidden because it contains spoiler information about the solution
One of the best kata I've done!
Solved it! My original idea did carry through.
May I know why this is the case? Why does the checker take so long to fail short arrays (by default)? This is no longer an issue, but it still can't fail
[[1]]
in time.The program consistently times out even if the function always returns an empty array.
The "dictionary" and the "adjacency list" are quite similar in structure, and one of them should be taken out as a redundant test case. The kata should be testing the conversion of "edge list" instead of "adjacency list".
In most languages, subtraction comes before shifting. Could this be phrased as
abs((n >> 1) - k) ≤ 4
?This was a pain - a beautiful, sensational type of pain.
THANK YOU!
Changed!
Thanks for pointing that out!
Thank you for completing my kata! I especially loved the process of creating this one.
Unfortunately I can't remove solutions, but I'm glad you submitted a final solution after debugging.
No problem.
Here is my JavaScript translation: https://www.codewars.com/kumite/6545ce33b3e7770024f678e2/edit
It's been fixed. Would you like to try?
Loading more items...