Given positive integer n
implement a function which returns a list containing all steps up from 0
to n
and down to
0
.
countUpAndDown(1) // [0, 1, 0]
countUpAndDown(2) // [0, 1, 2, 1, 0]
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Given positive integer n
implement a function which returns a list containing all steps up from 0
to n
and down to
0
.
countUpAndDown(1) // [0, 1, 0]
countUpAndDown(2) // [0, 1, 2, 1, 0]