Ad
  • Custom User Avatar
  • Custom User Avatar

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

  • Default User Avatar

    Without knowing specifics for your solution, It'll be tough to comment. Furthermore, the challenge of this kata, as denoted by the tag, is that it's a puzzle, more so that a programming exercise.

    If you havent already, try getting out a pen and paper, and workout a few examples, and try and spot a pattern.
    Also, you are tasked to find the value for f(n), so try to be deliberate on this intermidiate value. Keep this in your mind, when looking for patterns.

    Anymore than this, unfortunately will give away too much, and I don’t want to rob you of the satisfaction when you finally solve this!

  • Default User Avatar

    please remember to use the spoiler flag when discussing code, otherwise anyone can see it on the dashboard. I have activated the flag for your comment just now. also, please mind your unnecessarily terse language, thank you.

  • Custom User Avatar

    Just copy them from the description ;-)

  • Custom User Avatar

    it's weird because it's the same number of digits

    You assume that computer sees numbers as digits the same way as you do. For computer, it;s not the same number of digits. The 11 which got lost is exactly the digits which did not fit into the place where the number is located.

  • Custom User Avatar

    Do NOT use parseInt, that's the whole point of this kata. This has nothing to do with JavaScript and the only "issue" is on your end.

  • Custom User Avatar

    It's difficult to tell exactly without knowing what you test and how, but generally the thing is (warning: simplifications and thought shortcuts ahead): the basic type of numbers in JS has a limited size in memory. When you multiply two large numbers, it's possible that the result is so large it will not fit into the designated space in memory. When this happens, what JS does is to keep the high part of the number, and lose the lower part of the number. The difference of 11 you see is the part which got lost because it couldnt be crammed into the space the number was located.

    It's a simplification, and there are places where things are done differently. For example, numbers in JS can be bigger than in some languages, and smaller than in other languages. Some languages do not cut off large numbers and always keep them whole. Some languages do no allow for cutting off and if it should occur, they crash. Details can vary depending on circumstances.

  • Custom User Avatar

    if the code array is {2, 4, 6, 9} and you return an array {2, 3, 5, 7}, it will give 1 as the answer (in next input) - yes

  • Custom User Avatar

    Hi, I guess it is integer part.:-)

  • Default User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    not all code paths return a value

    Make that all code paths return a value.

  • Default User Avatar

    You can try training again and submitting the solution again, don't know if it'll work. But if your concern is whether or not it counts as completed, it does count, you wouldn't be able to see other people's answers if you didn't complete it, also it appears as completed in your profile.

  • Default User Avatar

    hhhhhhhhhhhhhhhh

  • Loading more items...