Skip to content

Commit

Permalink
Merge pull request #186 from Stegallo/2015
Browse files Browse the repository at this point in the history
day5
  • Loading branch information
Stegallo authored Nov 6, 2023
2 parents ef14cdc + ad243cb commit 6a78587
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions y_2015/day5.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def nice(self) -> bool:
def __has_pair_twice(self) -> bool:
len_text = len(self.text)
for i in range(len_text - 2):
for j in range(i + 2, len_text - 1):
if self.text[i : i + 2] == self.text[j : j + 2]:
return True
if self.text[i : i + 2] in self.text[i + 2 :]:
return True

return False

Expand Down

0 comments on commit 6a78587

Please sign in to comment.