mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-25 21:58:57 +01:00
remove unnecessary variable
This commit is contained in:
parent
aeb7ee9e53
commit
fb2e8a9fd2
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue