mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-28 19:58:20 +01:00
Drop unused .each
This commit is contained in:
parent
f072feacff
commit
627ab8a265
1 changed files with 1 additions and 1 deletions
|
@ -148,7 +148,7 @@ def products(nums)
|
|||
# so the product would be 1
|
||||
product = 1
|
||||
|
||||
(nums.count - 1).downto(1).each do |i|
|
||||
(nums.count - 1).downto(1) do |i|
|
||||
num = nums[i]
|
||||
# For the index 'i', product would contain the
|
||||
# product of all elements to the right. We update product accordingly.
|
||||
|
|
Loading…
Add table
Reference in a new issue