From 95930cc22925d40a7d9e004ec2838916676af0d3 Mon Sep 17 00:00:00 2001 From: domix80 Date: Tue, 21 Feb 2023 18:12:39 +0100 Subject: [PATCH] Update solution file and remove link from directory --- DIRECTORY.md | 2 -- project_euler/problem_006/sol1.rb | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 59f47c0..51a0e9e 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -153,8 +153,6 @@ * [Sol2](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_004/sol2.rb) * Problem 005 * [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 * [Sol1](https://github.com/TheAlgorithms/Ruby/blob/master/project_euler/problem_020/sol1.rb) * Problem 021 diff --git a/project_euler/problem_006/sol1.rb b/project_euler/problem_006/sol1.rb index 28de45c..a243852 100644 --- a/project_euler/problem_006/sol1.rb +++ b/project_euler/problem_006/sol1.rb @@ -11,7 +11,8 @@ #Find the difference between the sum of the squares of the first one #hundred natural numbers and the square of the sum. -def solution?(num) +def solution?() + num = 10 x = 1 y = 1 result = 1 @@ -28,8 +29,5 @@ def solution?(num) r_sum_n_pow2 - r_n_pow2_plus_n_pow2 end -answer = 0 -answer = solution?(10) - - +answer = solution?() p answer