We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 881b318 commit 731d73fCopy full SHA for 731d73f
project_euler/problem_099/sol1.py
@@ -22,12 +22,14 @@ def solution(data_file: str = "base_exp.txt") -> int:
22
>>> solution()
23
709
24
"""
25
- largest = [0, 0]
+ largest: float = 0
26
+ result = 0
27
for i, line in enumerate(open(os.path.join(os.path.dirname(__file__), data_file))):
28
a, x = list(map(int, line.split(",")))
- if x * log10(a) > largest[0]:
29
- largest = [x * log10(a), i + 1]
30
- return largest[1]
+ if x * log10(a) > largest:
+ largest = x * log10(a)
31
+ result = i + 1
32
+ return result
33
34
35
if __name__ == "__main__":
0 commit comments