How to give custom input in this...MAXIMUM SUBARRAY SUM

Exception in thread “main” java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Main.main(Main.java:12)

my code is:

click on provide custom input…a box will show up…provide your input as specified in the ques in that box

the logic of your code is not fine…your code will just some the positive values in the array and return that sum…but we require max CONTIGUOUS sum(SUBARRAY)

i have changed the code now and still there is some error…can you tell me what i m doing wrong

declare maxendinghere and maxsofar inside for loop as they have to be initialised to 0 for every test case

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.