mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-11-16 19:50:00 +01:00
Update project_euler/problem_006/sol1.rb
Co-authored-by: Amos Paribocci <aparibocci@gmail.com>
This commit is contained in:
parent
1fd68f225a
commit
bb5df87537
1 changed files with 2 additions and 3 deletions
|
@ -11,8 +11,7 @@
|
||||||
#Find the difference between the sum of the squares of the first one
|
#Find the difference between the sum of the squares of the first one
|
||||||
#hundred natural numbers and the square of the sum.
|
#hundred natural numbers and the square of the sum.
|
||||||
|
|
||||||
def solution?()
|
def solution(num=10)
|
||||||
num = 10
|
|
||||||
x = 1
|
x = 1
|
||||||
y = 1
|
y = 1
|
||||||
result = 1
|
result = 1
|
||||||
|
@ -29,5 +28,5 @@ def solution?()
|
||||||
r_sum_n_pow2 - r_n_pow2_plus_n_pow2
|
r_sum_n_pow2 - r_n_pow2_plus_n_pow2
|
||||||
end
|
end
|
||||||
|
|
||||||
answer = solution?()
|
answer = solution()
|
||||||
p answer
|
p answer
|
||||||
|
|
Loading…
Reference in a new issue