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.
Hey, it is my first kata, so I have some questions. What is the correct way to do it? I understand that I should generate int array and then compare result of my own function with result of tested one. Is it right? Where should I place code of my function? In code of test cases?
The task is formulated so easy, but I've spend about 5 hours to solve it. myjinxin2015, you've made excellent kata. Thank you!
The task is formulated so easy, but I've spent about 5 hours to solve it. myjinxin2015, you've made excellent kata. Thank you!
It is simple to solve if you will use the automata that is given by link. I was trying to solve it during few hours, then I looked the automata and solved it in few minutes.
If mx = 2, then gap(3, 5, 6) return [2, 5], but 2 isn't between 5 and 6.
I believe that the correct way is to write 'mx && m - mx === g'
What do you mean? I meant that it could be solved by using explicit formula with Math.log() function. In this case, there are not loops.
This comment is hidden because it contains spoiler information about the solution
This task could be solved by math without cycles and recursions, that should work faster for large numbers.
This solution is bad. It is not about complexity, it is about memory usage. There is O(n) additional memory.