We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5eed35 commit 9a27564Copy full SHA for 9a27564
day06/1.py
@@ -6,10 +6,9 @@
6
7
def main():
8
data = sys.stdin.read().strip()
9
- for i in range(len(data) - WINSIZ):
10
- if len(set(data[i:i + WINSIZ])) == WINSIZ:
11
- print(i + WINSIZ)
12
- break
+ nchars = next(i + WINSIZ for i in range(len(data) - WINSIZ)
+ if len(set(data[i:i + WINSIZ])) == WINSIZ)
+ print(nchars)
13
14
if __name__ == '__main__':
15
main()
day06/2.py
0 commit comments