aufgabe 4
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import time
|
||||
#file = "./ex.txt"
|
||||
file = "./input.txt"
|
||||
start = time.time()
|
||||
|
||||
def find_num(l:str) -> int:
|
||||
numbers = "9876543210"
|
||||
@@ -15,7 +16,7 @@ def find_num(l:str) -> int:
|
||||
if n == l[i] and zell > len(nums):
|
||||
pos = i+1
|
||||
nums.append(n)
|
||||
print("".join(nums))
|
||||
# print("".join(nums))
|
||||
return int("".join(nums))
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -26,4 +27,4 @@ if __name__ == "__main__":
|
||||
if line == "":
|
||||
continue
|
||||
solution += find_num(line)
|
||||
print(f"Solution: {solution}")
|
||||
print(f"Solution: {solution} benötigte Zeit:{time.time()-start} s")
|
||||
Reference in New Issue
Block a user