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 suggestion is useless without specifying languages it applies to.
Woah, I didn't know you can send picture in comment section.
That's true. A lot of solutions (including me) extended the initial array just to return the final value of the iteration, which seeing this kind of solution, seems very inneficient and unnecessary.
Yes I agree with goodwin64.The adjustment is not enough for the method
...which is still much better than creating an array of length
n
, just to return the last value.Print out the results and think about why you are getting that number!
the same trouble
You can imagine that the author is your boss ;-)
He always had some strange requests. Such as reverse a string, making a palindrome string, count the vowel characters...
All you can do is output data as required, and don't complain about why it's not a different format. Hahaha! :D:D:D
Why is that?
assertSimilar
works well for arrays.Two corrections.
If the principal is already greater than or equal to the desired, the function SHOULD return 0. It's even mentioned in the instructions.
Second - this should be greater than or equal to, not just equal to
kyu and tags (I put only
Fundamentals
) were given by a moderator not by the author.Except brute force DOES work. On my hardware, you have to use parameters in the 100,000 range before it takes a minute. 10,000 is done in 5 seconds. As is, this is a 7 or 8 kyu. If you want it to be a 4 kyu, all that needs to be done is to add test cases where the brute force times out the server and you have to optimize to have a complete solution.
This comment is hidden because it contains spoiler information about the solution
Translated your kata into Ruby and you have another translation pending: if you wish to approve both, then I can edit it (if I do it before we would get merge errors) to see if I can produce what you wish for :)
I'd be happy :)
Loading more items...