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.
There's an algorithm called Fermat's factorization method that you can look up on Wikipedia.
You can use ESLint or Prettier to achieve this format.
getSize(4,2,6) returns [88,48]
when getSize(4,2,6)[1] refers to [88,48][1] = 48, test case refering to ouput index value.
In the tests, twice I am given an array of [4,2,6]. I fail the first test as expected output is 88, 48 but succeed on the second with output of 48, 48.
I know it's an old question but I would love to know the answer to this one!
RTFM... x/
test.assert_equals(find_short("bitcoin take over the world maybe who knows perhaps"), 3)
Actually 2 ("the", "who")
Issues in test cases
This comment is hidden because it contains spoiler information about the solution
No, you're not, check in Solutions, there are more that used it too. Note that's not the best approach.
This comment is hidden because it contains spoiler information about the solution
Stealing this formatting from now on! Very readable
Why not a
for
loop? :D https://www.codewars.com/kumite/57cab2bbfa9fc5df340007d6?sel=5d6946c80725d3001fb10eb1I think this one is the most readable. Anyone else use a do-while?
super elegant!
This comment is hidden because it contains spoiler information about the solution