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.
Works, but not 100% correct. The number at the current index is always added to the left and right sum. By definition, the number at the current index should not be taken into account:
"...
Last one:
You are given the array {20,10,-80,10,10,15,35}
At index 0 the left side is {}
The right side is {10,-80,10,10,15,35}
They both are equal to 0 when added. (Empty arrays are equal to 0 in this problem)
Index 0 is the place where the left side and right side are equal.
...
"
Here, left and right sum are 20 at index 0.
Beautiful
'A'.ord has a value of 65 and if you subtract 64 it will be 1
just WOW!
Aaaaaaaaaah, it's a progression. Aaaaaaaaaah… indeed, this is better than (1..num).sum, cuz if num == 1e36, then we're in trouble. Good stuff! Thanks!
Beautiful
Nice
bruhhh
It is a hard to read one-liner, why is it voted as "best practice"?
This comment is hidden because it contains spoiler information about the solution
Гений
Wouldn't this be the best to put in your code if you need to calculate that ?
This is the fastest and best solution.
poetic
Ooh! I haven't seen each_cons. I like that.
Loading more items...