Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 380 Bytes

File metadata and controls

20 lines (12 loc) · 380 Bytes

Count up and down

Nice to solve before

Count down

Instructions

Given positive integer n implement a function which returns a list containing all steps up from 0 to n and down to 0.

challenge | solution

Examples

countUpAndDown(1) // [0, 1, 0]

countUpAndDown(2) // [0, 1, 2, 1, 0]