Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 366 Bytes

File metadata and controls

19 lines (11 loc) · 366 Bytes

Print numbers

Instructions

Given positive integer n implement a function which returns a list representing all numbers from n to 1. If n value is zero then empty list should be returned.

challenge | solution

Examples

printNumber(0) // []

printNumber(2) // [2, 1]

printNumber(5) // [5, 4, 3, 2, 1]