All challenges
Easy 0 solved 0% acceptance

Countdown to Liftoff

Count down from a number and end with Liftoff!

Problem

Count down from start to 1, then add "Liftoff!". Each number becomes one text entry.

Implement countdown(start).

Input

start: The number to start counting down from.

Output

Return the countdown as a list of strings, ending with "Liftoff!".

Constraints

0 ≤ start ≤ 1,000

Examples

Example 1
Input:
start = 3

Expected output:
expected = ["3", "2", "1", "Liftoff!"]
Input:
long long start = 3;

Expected output:
std::vector<std::string> expected = {"3", "2", "1", "Liftoff!"};
Input:
long start = 3;

Expected output:
string[] expected = new string[] {"3", "2", "1", "Liftoff!"};

Explanation

"3", "2", "1", then "Liftoff!".

Example 2
Input:
start = 0

Expected output:
expected = ["Liftoff!"]
Input:
long long start = 0;

Expected output:
std::vector<std::string> expected = {"Liftoff!"};
Input:
long start = 0;

Expected output:
string[] expected = new string[] {"Liftoff!"};

Explanation

There is nothing to count, so only "Liftoff!" remains.

References

This challenge is adapted for CodeUtility. Follow the statement and constraints above.

Learn from others

Community solutions

No published solutions yet. Solve this challenge to share the first one.