Ad
  • Custom User Avatar

    That is not at all clever nor best practice as he added true:false in the end that does absolutely nothing lmao.

  • Custom User Avatar

    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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Not so efficient to compute .sqrt(n) twice (instead of saving it in a variable first)

  • Default User Avatar

    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.

  • Default User Avatar

    Can someone please explain to me the logic behind the whole ternary conditional part of this solution???

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    yo

    have you solved this?

    any hint as to why the last test case is wrong?

  • Default User Avatar

    Yea the last test isnt working for me too?? what exactly is it entering?

  • Default User Avatar

    Yea, I realized that about an hour ago and fixed everything up. Thanks for the help though!

  • Custom User Avatar

    Your code returns extra space at the beginning of the string. That's why it fails. For example, with your code nameShuffler('Richard Cheese') returns

    " Cheese Richard"
    
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Default User Avatar

    Wrote the correct solution for javascript and everything is being returned exactly the same as the expected results... Still says I'm wrong???