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.
Why not some linebreaks to make it readable
As it reads
{1,4,4,4,0,4,3,3,1} becomes:
{1,12,null,null,0,4,6,null,1}
I'm confused how this solution doesn't produce {1,12,8,4,0,4,6,3,1} for Input: {1,4,4,4,0,4,3,3,1} but I couldn't figure out any one liner so what do I know.
Is it possible to get a break down of this solution please?
I knew it will be a one liver through Linq meanwhile my solution is like tens of lines lol
Same here, spent about a day trying to solve it.
im in awe, i pondered over this for a while
Linq is indeed a very effective technology
People who master the arts of Linq see the world in a different perspective ^^
You are right.
It should be done in two steps:
Otherwise I still like this solution better, than those which sum n-times over the n previous elements.
res[i - 1] * 2 could possibly overflow the double type.
This comment is hidden because it contains spoiler information about the solution