Alle Herausforderungen
Einfach 0 gelöst 0% Erfolgsquote

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!".

Einschränkungen

0 ≤ start ≤ 1,000

Beispiele

Beispiel 1
Eingabe:
start = 3

Erwartete Ausgabe:
expected = ["3", "2", "1", "Liftoff!"]
Eingabe:
long long start = 3;

Erwartete Ausgabe:
std::vector<std::string> expected = {"3", "2", "1", "Liftoff!"};
Eingabe:
long start = 3;

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

Erläuterung

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

Beispiel 2
Eingabe:
start = 0

Erwartete Ausgabe:
expected = ["Liftoff!"]
Eingabe:
long long start = 0;

Erwartete Ausgabe:
std::vector<std::string> expected = {"Liftoff!"};
Eingabe:
long start = 0;

Erwartete Ausgabe:
string[] expected = new string[] {"Liftoff!"};

Erläuterung

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

Referenzen

Diese Aufgabe wurde für CodeUtility angepasst. Beachte die oben genannten Vorgaben und Einschränkungen.

Von anderen lernen

Community-Lösungen

Noch keine veröffentlichten Lösungen. Löse die Aufgabe und teile als Erster eine Lösung.