mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-27 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}
|
# @return {Integer}
|
||||||
def largest_altitude(gain)
|
def largest_altitude(gain)
|
||||||
arr = [0]
|
arr = [0]
|
||||||
points = gain.count
|
|
||||||
|
|
||||||
# calculate altitude array
|
# calculate altitude array
|
||||||
(1..points).each do |pointer|
|
(1..gain.count).each do |pointer|
|
||||||
sum = arr[pointer - 1] + gain[pointer - 1]
|
sum = arr[pointer - 1] + gain[pointer - 1]
|
||||||
arr.push(sum)
|
arr.push(sum)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue