Click here to see the full article post
Why don't you need to check for array bound line[i:i+2] in Python, but you did check that in Java
@apeforest In python, it will ignore extra elements of the slice. For example
'ab'[1:10] = 'b', 'ab'[10:20] = ''
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.