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.
Updated.
Updated.
Would you accept the translation if I changed the function name?
@JohanWiltink I added random tests. Can a rejected translation be opened?
I just tried it. It works now.
I think this is why I give up with Swift in codewars. The tests run and pass in 6ms but the process timesout in 12000ms and fails.
Passed: 2 Failed: 0 Errors: 1
Test Results:
SolutionTest
Tests From Example (pass in 4.5ms)
Tests Large Diamonds (pass in 0.3ms)
Completed in 6.611ms
RandomTest
STDERR:
Process was terminated. It took longer than 12000ms to complete
My Swift solution couldn't use arc4random_uniform in Codewars so I wrote my own random function using time.
The tests should exclude the
num
label. Change findDigit to:I thought about the structure of bowling pins or the balls on a pool table. How many balls would I need if I had four rows?