Skip to content

Latest commit

 

History

History
 
 

count_up_then_down

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Count up and down

Nice to solve before

Count down

Instructions

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

Challenge | Solution

Examples

count_up_then_down(1) # [0, 1, 0]

count_up_then_down(2) # [0, 1, 2, 1, 0]