• + 1 comment

    Hi, there are two issues with the code.

    First : you are using 'max' function over string without converting it to integer which would give different result. For example :

    max(["1","3","9","11"]) #Result : '9' 
    max([1,3,9,11])         #Result : 11 
    

    Second : Because of pop function, the length of list reduces inside the loop, though the loop continues to run till the index specified earlier. Hence, giving "out of range" error.

    Remove these two errors, code will run fine.

    Hope it helps ! :)