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.
That is not at all clever nor best practice as he added true:false in the end that does absolutely nothing lmao.
For those who see this and are still interested:
if (i < 3), r at index i is copied from s, r[i] uses the defined tribonacci sequence.
This comment is hidden because it contains spoiler information about the solution
Not so efficient to compute .sqrt(n) twice (instead of saving it in a variable first)
For javascript, the "run test" option doesnt work (this needs to be fixed). Just test it as a final submition.. And this seems a bit too easy for a 5 kyu, but a good kata nonetheless.
Can someone please explain to me the logic behind the whole ternary conditional part of this solution???
Hi RySkinz, your code looks fine to me. Re your question, a lot of the Kata can be split into a) those that need more coding skills and b) those that need more maths and logic skills - although our codes show that you can often do them in either way. But if you do web searches for the type of problem at hand, for example, "rectangles within rectangles" with words like combinations, permutations and maths, you will often find a math explanation. Also there is a site called stackoverflow that is very good for programming questions and answers. P.S. I'm largely self taught at coding myself.
Hey man, im a self-taught coder. It took me a while to figure out the solution for this one, I did it a completely different way. It would have been much easier if I had used the same sort of mathematical logic like you did. What does one read/should know to think like this.
yo
have you solved this?
any hint as to why the last test case is wrong?
Yea the last test isnt working for me too?? what exactly is it entering?
Yea, I realized that about an hour ago and fixed everything up. Thanks for the help though!
Your code returns extra space at the beginning of the string. That's why it fails. For example, with your code
nameShuffler('Richard Cheese')
returnsThis comment is hidden because it contains spoiler information about the solution
Show us your attempted solution, we'll try to help.
One of common newbie mistakes is printing the result instead of returning it. Consider checking your solution for that.
Wrote the correct solution for javascript and everything is being returned exactly the same as the expected results... Still says I'm wrong???