This is a simple problem, but I’m stuck because I’m unable to figure out how take input from user as shown in sample input. As it’s not a space separated input, it’s sort of one integer in one line input. So help me out to figure how to take this input in python 3 .
Thank You
How to take a single input in a single line from user
Hey @pasta, you have to use a while loop, and take input in any variable say n = int(input()), and keep taking inputs untill the cumulative sum is non negative. As soon as it becomes negative stop processing the input.
HOpe this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. 