Can you explain run error please

My codes are running fine but while submitting they are given run error what does that mean

@KushagraNITJ, the problem is that in some test cases there is a space after array elements which is creating problem , let me explain what i mean
you are taking array as a string and then tokenizing wrt space , but there are some test cases in which array input ends with a space

1
5
1 2 3 4 5" "  

so when you do int(i) where i="5 "
you will get valueError: invalid literal for int() with base 10: ’ ’

i have taken that into account but i am still getting it wrong even to it works fine on my sample test case

your logic is not correct, because what you are doing is you are appending the same array to the end of array and then you are applying kadane’s algo but the problem is the size of the new array is now twice of the original array and in case if you choose subarray with size greater than the original array you will get wrong answer , let me explain how,
suppose the input is ,
5
1 1 1 1 1

according to your algo
you will make a new array : 1 1 1 1 1 1 1 1 1
and the apply kadane which will give ans as 9 (you are adding starting 4 elements twice)
but the actual answer is 5

you can refer this for hint :- Please provide hint

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.