diff --git a/data_structures/arrays/find_the_highest_altitude.rb b/data_structures/arrays/find_the_highest_altitude.rb index 73287b1..680b880 100644 --- a/data_structures/arrays/find_the_highest_altitude.rb +++ b/data_structures/arrays/find_the_highest_altitude.rb @@ -26,10 +26,9 @@ # @return {Integer} def largest_altitude(gain) arr = [0] - points = gain.count # calculate altitude array - (1..points).each do |pointer| + (1..gain.count).each do |pointer| sum = arr[pointer - 1] + gain[pointer - 1] arr.push(sum) end