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.
me to :')
Omg. Of course. I'm an idiot. XD
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Mine could've been a one-liner too but I stored (n*2-1) in a variable since it is called 2 times
Man these soultions make me feel like an idiot
We can actually have a subarray that maximizes the sum and contains a negative element in it. For example : [3,-1,5] ( The whole array maximizes the sum and has a -1 in it )
[-1,3,-1,5,1] ( [3,-1,5,1] maximizes the sum and has a -1 in it )
brilliant
How and why does this work?
I was focused on the 'contiguous' sub-array sum and kept trying to go for that with my first solution, but ended up giving up after failing to optimize my code. And I'm honestly disappointed in myself and dumbstruck at how simple this solution is, that I had to try it for myself.
Well that was stupid of me
I missed that fucking detail
I used a solution really similar to this one, yet I have no fucking how clue why it work, I know HOW, but not WHY lmao
This comment is hidden because it contains spoiler information about the solution
it pains me to see this after submitting my code
I want to punch my monitor wtf dude!!! here i have like 14-15 lines of code, anyways good job dude!
Loading more items...