Completed day 6
This commit is contained in:
14
2022/Day-06/day01-1.py
Normal file
14
2022/Day-06/day01-1.py
Normal 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
14
2022/Day-06/day01-2.py
Normal 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
14
2022/Day-06/day06-1.py
Normal 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
14
2022/Day-06/day06-2.py
Normal 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)
|
Reference in New Issue
Block a user