please look into my code
M trying to solve today's hacker blocks problem i.e max sub array sum but not able to make it
you have to take the input elements from the array inside the while loop . you are taking the input outside the while loop . And also check your algo by dry running few of the sample test cases
Hope it helps