mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-02-10 20:48:11 +01:00
Update solution file and remove link from directory
This commit is contained in:
parent
612f4bfa32
commit
95930cc229
2 changed files with 3 additions and 7 deletions
|
@ -153,8 +153,6 @@
|
||||||
* [Sol2](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_004/sol2.rb)
|
* [Sol2](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_004/sol2.rb)
|
||||||
* Problem 005
|
* Problem 005
|
||||||
* [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_005/sol1.rb)
|
* [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_005/sol1.rb)
|
||||||
* Problem 006
|
|
||||||
* [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_006/sol1.rb)
|
|
||||||
* Problem 020
|
* Problem 020
|
||||||
* [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_020/sol1.rb)
|
* [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_020/sol1.rb)
|
||||||
* Problem 021
|
* Problem 021
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
#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?(num)
|
def solution?()
|
||||||
|
num = 10
|
||||||
x = 1
|
x = 1
|
||||||
y = 1
|
y = 1
|
||||||
result = 1
|
result = 1
|
||||||
|
@ -28,8 +29,5 @@ def solution?(num)
|
||||||
r_sum_n_pow2 - r_n_pow2_plus_n_pow2
|
r_sum_n_pow2 - r_n_pow2_plus_n_pow2
|
||||||
end
|
end
|
||||||
|
|
||||||
answer = 0
|
answer = solution?()
|
||||||
answer = solution?(10)
|
|
||||||
|
|
||||||
|
|
||||||
p answer
|
p answer
|
||||||
|
|
Loading…
Add table
Reference in a new issue