모든 챌린지
쉬움 0명 해결 정답률 0%

Countdown to Liftoff

Count down from a number and end with Liftoff!

문제

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에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.

다른 사람의 풀이 보기

커뮤니티 솔루션

아직 공개된 풀이가 없습니다. 문제를 풀고 첫 풀이를 공유하세요.