Update project_euler/problem_006/sol1.rb

Co-authored-by: Amos Paribocci <aparibocci@gmail.com>
This commit is contained in:
domix80 2023-02-21 18:36:46 +01:00 committed by GitHub
parent 1fd68f225a
commit bb5df87537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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