Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s
- SR TR R LI E )
- e )
- 7 array.each_with_index do |item, index|
- [ sum += item if index.odd?
- R
- EURE)
- FE Y
- 12
- 13 # TODO: computes the sum of elements at odd indexes (1, 3, 5, 7, etc.)
- 31 B You should use Enumerable#each_with_index
- 15
Advertisement
Add Comment
Please, Sign In to add comment