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.
how do you find this formula?
never saw abs before) thanks
Wow, great answer. This answer demostraste that knowledge of a language is key. Great solution!
Approved by someone
genius
Functions With an Implicit Return
search here - https://docs.swift.org/swift-book/LanguageGuide/Functions.html
Where "return"? How it work?
I like this solution a lot!
Thank you so much brother
Sure thing! This is the Ternary Operator, it's basically a single line if condition. The question mark asks whatever is on it's left if it's true or false. It then tells the colon to pick whatever is to it's left if the condition is true, or to it's right if the condition is false
You should take a look at the official Swift documentation https://docs.swift.org/swift-book/LanguageGuide/BasicOperators.html. You can search for Ternary and you'll find whatever you're looking for
hey could someone explain this code to me please
Hi there! Is is possible for you to explain this line of code in a bit more human way? I am still very new to Swift and I would like to understand what actually does this abs, reduce(1,*) :)) Thanks in advance for that!
it's makes additional memory allocations on any appends on filtered array
Lovely <3 gg wp
Keep array of elements lengths is better practice than using joined every iteration.
I used same approach
Loading more items...