Skip to content

Files

Latest commit

author
Aneta Solunska
Aug 8, 2024
f050d4e · Aug 8, 2024

History

History
This branch is 2 commits ahead of, 16 commits behind igorwojda/kotlin-coding-challenges:main.

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 8, 2024
Feb 7, 2023
Feb 7, 2023

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]