wes d2a2ba9e15 first commit 4 vuotta sitten
..
README.md d2a2ba9e15 first commit 4 vuotta sitten
code.cpp d2a2ba9e15 first commit 4 vuotta sitten
unitTest.cpp d2a2ba9e15 first commit 4 vuotta sitten

README.md

Generate a Countdown of Numbers in an Array

by Helen Yu tags: arrays, loops

Summary

Create a function that takes a number as an argument and returns an array of numbers counting down from this number to zero. Examples countdown(5) ➞ [5, 4, 3, 2, 1, 0] countdown(1) ➞ [1, 0] countdown(0) ➞ [0] Notes The argument will always be greater than or equal to zero.

Instructions

Create a function that takes a number as an argument and returns an array of numbers counting down from this number to zero.

Examples

countdown(5) ➞ [5, 4, 3, 2, 1, 0]

countdown(1) ➞ [1, 0]

countdown(0) ➞ [0]

Notes

The argument will always be greater than or equal to zero.