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.
.
This comment is hidden because it contains spoiler information about the solution
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!
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.
Just copy them from the description ;-)
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.
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.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.
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
Hi, I guess it is integer part.:-)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Make that all code paths return a value.
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.
hhhhhhhhhhhhhhhh
Loading more items...