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.
The items in the array are directions, not positions.
bruteforce is possible too
This comment is hidden because it contains spoiler information about the solution
What helped me, is not to view the problem as an image of boxes placed in staggered manner, but rather sequnce of numbers. Then it is easier to see the solution (Dont overly complicate the solution, because it is much easier than what it seems)
This comment is hidden because it contains spoiler information about the solution
Click Reset, and try again.
closing
Your code is wrong, not a kata issue, it only replaces a single
!
.Think about what the best number of steps for the cat to jump is in each possible scenario.
Hi - first of all, please don't use Issue tag; that is reserved for problems with the kata - if you have problems with your solution use the Question tag.
Secondly, I don't use JavaScript (#blessed) but I'm guessing that the method you are using will encounter problems with very large arrays - your "big number" probably isn't big enough to break your code: the random tests involve values of
n = 9876543210
so try in VSCode to see if such an input works with your current solution (it won't).Read the description more carefully, the houses are numbered in opposite directions.
I can't answer your question with the correct "words" because then it will spoil the kata for other people, so let me try to explain as best as I can:
Without seeing your code, I'm guessing that the way you implemented the
thing_you_mentioned_in_your_question
is using the basic "naive" approach (probably involving recursion?).If you are a beginner, this will be a very valuable teaching/learning experience for you so, all I will tell you (this is a 5 kyu kata so it is supposed to be a bit challenging) is: there are better ways of implementing the
thing_you_mentioned
.In fact studying
thing_you_mentioned
is a classic example used in many programming textbooks, so you should find lots of detailled explanations with some simple internet searching.Fixed. About the timeout, could be your code, make sure you don't have an infinite loop.
You should read the description again. It says that you should take as much big pieces as possible to reach the goal. Your second if statement clearly breaks that rule. Also some of the other conditions seem nonsensical.
Loading more items...