समस्या
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!".
सीमाएँ
0 ≤ start ≤ 1,000
उदाहरण
उदाहरण 1
इनपुट:
start = 3
अपेक्षित आउटपुट:
expected = ["3", "2", "1", "Liftoff!"]
इनपुट:
long long start = 3;
अपेक्षित आउटपुट:
std::vector<std::string> expected = {"3", "2", "1", "Liftoff!"};
इनपुट:
long start = 3;
अपेक्षित आउटपुट:
string[] expected = new string[] {"3", "2", "1", "Liftoff!"};
व्याख्या
"3", "2", "1", then "Liftoff!".
उदाहरण 2
इनपुट:
start = 0
अपेक्षित आउटपुट:
expected = ["Liftoff!"]
इनपुट:
long long start = 0;
अपेक्षित आउटपुट:
std::vector<std::string> expected = {"Liftoff!"};
इनपुट:
long start = 0;
अपेक्षित आउटपुट:
string[] expected = new string[] {"Liftoff!"};
व्याख्या
There is nothing to count, so only "Liftoff!" remains.
संदर्भ
यह चुनौती CodeUtility के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।