문제
Draw a hollow square of side size: the first and last rows are all *, and the rows in between have * only at the two ends with spaces inside.
Implement hollow_square(size).
Input
size: The side length.
Output
Return the rows from top to bottom.
제약 조건
1 ≤ size ≤ 50
예시
예시 1
입력:
size = 4
예상 출력:
expected = ["****", "* *", "* *", "****"]
입력:
long long size = 4;
예상 출력:
std::vector<std::string> expected = {"****", "* *", "* *", "****"};
입력:
long size = 4;
예상 출력:
string[] expected = new string[] {"****", "* *", "* *", "****"};
설명
Rows are "****", "* *", "* *", "****".
예시 2
입력:
size = 1
예상 출력:
expected = ["*"]
입력:
long long size = 1;
예상 출력:
std::vector<std::string> expected = {"*"};
입력:
long size = 1;
예상 출력:
string[] expected = new string[] {"*"};
설명
A 1×1 square is a single "*".
참고 자료
이 문제는 CodeUtility에 맞게 수정되었습니다. 위의 설명과 제한 조건을 따르세요.