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.
conversion to string and lookup in it can't be efficient
looks like String(bool) comparison against "true"
There is no precision for the output of 2 digits implemented
u can replace String(number).characters to numbers.description.compactMap { $0 }
cheater)))))
More random tests should be better (like, 10-20).
amazing.
It's literally in the title of this kata, and in the description:
Trianguluar Numbers
This comment is hidden because it contains spoiler information about the solution
How you created formulae for this sequence of numbers
Damn! That's genious
Nice and elegant solution!
But doesn't work with swift5.
Consider to delete ".characters"
What do you mean by "optimization"?
Both
.description
andString()
work the same way for integers - String initializer, Integer descriptionEdit:
Oh, I've noticed what you meant -
number.description.sorted {...}
? Not sure about optimization, but easier to read for sure.This is the easiest to read. I just used a regular if statement though.
Looks good. You can optimize this by replacing String(number).characters with number.description
Loading more items...