Quick simplification fix

This commit is contained in:
TiagoRG 2023-02-03 17:32:28 +00:00
parent 66979f317e
commit 557dbb8ff7
1 changed files with 1 additions and 5 deletions

View File

@ -5,12 +5,8 @@
# os primeiros n elementos igualam os últimos n elementos (sem sobreposição).
def firstEqualLast(lst):
if len(lst) <= 1:
return 0
n = 0
for i in range(1, len(lst)//2+1):
if lst[:i] == lst[len(lst)-i:]:
if lst[:i] == lst[-i:]:
n = i
return n