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.
Because you can't do
[1 1]
. And I have already explained it in the post above yours.ok / if we have number :
29 -> [1 29] -> 1 + 841 -> 842
why if we have number 1 :
1 -> [1 1] -> 1 ??
we can do 29 -> [1 29] -> 841 !!! 29 * 29 = 841 !!!!!
tell me plz why not
1 -> [1 1] -> 1+1 -> 2 ????
Because 1 has only one divisor, your reasoning is wrong. Try to find some source that says 1 has 2 divisors. They should be unique.
With the same wrong reasoning, 4 has 4 divisors: 1, 2, 2 and 4.
https://en.wikipedia.org/wiki/Table_of_divisors#1_to_100
https://www.mathsisfun.com/numbers/factors-multiples-table.html
https://www.teachoo.com/7605/2329/Table-of-factors-from-1-to-100/category/Prime-numbers-from-1-to-100/
https://www.mymathtables.com/numbers/one-hundred-factor-and-prime-factor-table.html
https://www2.math.upenn.edu/~deturck/m170/wk2/divisors.html
schanjr why do you say?
There is only one divisor of 1 and that's 1, why do you write it twice there?
Buddy, just because people can (and did) hardcode solutions to solve this issue, doesn't mean your kata doesn't have an issue.
Not a kata issue. Before posting issues look at the top of the page: 433 people passed the Ruby kata (out of 18127). If there were errors in the kata someone would have seen them before you. Cheers.
This comment is hidden because it contains spoiler information about the solution
It's linear, so it scales ok. Sure it's not optimized for very different lengths case, but optimized != best practice.
Best practice is right compromise between optimization and code clarity.