Created
July 11, 2017 06:06
-
-
Save shuson/bd2185b72114f868bb59d6affefca4da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sol(A): | |
n = len(A) | |
for i in range(n): | |
j = n-1 | |
while j > i: | |
if A[i] == A[j]: | |
return j - i | |
j -= 1 | |
return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment