Completed day 6

This commit is contained in:
2022-12-06 09:19:18 +00:00
parent 5eb10f931c
commit 02f299af17
4 changed files with 56 additions and 0 deletions

14
2022/Day-06/day01-1.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
input = open('input.txt', 'r').readline()
i = 0
different = []
while(len(different) < 4):
if(input[i] not in different):
different.append(input[i])
else:
different = []
i += 1
print(i - 1)

14
2022/Day-06/day01-2.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
input = open('input.txt', 'r').readline()
i = 0
different = []
while(len(different) < 13):
if(input[i] not in different):
different.append(input[i])
else:
different = []
i += 1
print(i - 1)

14
2022/Day-06/day06-1.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
input = open('input.txt', 'r').readline()
i = 0
different = []
while(len(different) < 4):
if(input[i] not in different):
different.append(input[i])
else:
different = []
i += 1
print(i - 1)

14
2022/Day-06/day06-2.py Normal file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
input = open('input.txt', 'r').readline()
i = 0
different = []
while(len(different) < 13):
if(input[i] not in different):
different.append(input[i])
else:
different = []
i += 1
print(i - 1)