Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 306 Bytes

reversed_sequence.md

File metadata and controls

13 lines (10 loc) · 306 Bytes

Description

Build a function that returns an array of integers from n to 1 where n>0.

Example : n=5 --> [5,4,3,2,1]

My Solution

def reverse_seq(n)
  n.downto(1).to_a
end