solved hackkerrank problem

https://www.hackerrank.com/challenges/maxsubarray/submissions/code/24675
21