Skip to content

Commit 076f202

Browse files
committed
Update sol1.rb
1 parent 1b45e7b commit 076f202

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

project_euler/problem_025/sol1.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
#The 12th term, F12, is the first term to contain three digits.
1919
#What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
2020

21-
def solution?()
21+
def solution(num_digits = 1000)
2222
#Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
2323
resultn1 = 1
2424
resultn2 = 1
2525
result = 2
2626
index = 3
27-
num_digits = 1000
2827
value = true
2928
while value
3029
resultn2 = resultn1
@@ -40,6 +39,6 @@ def solution?()
4039
res = index
4140
end
4241

43-
answer = solution?()
42+
answer = solution()
4443
p answer
4544

0 commit comments

Comments
 (0)