Problema
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.
Restrições
1 ≤ size ≤ 50
Exemplos
Exemplo 1
Entrada:
size = 4
Saída esperada:
expected = ["****", "* *", "* *", "****"]
Entrada:
long long size = 4;
Saída esperada:
std::vector<std::string> expected = {"****", "* *", "* *", "****"};
Entrada:
long size = 4;
Saída esperada:
string[] expected = new string[] {"****", "* *", "* *", "****"};
Explicação
Rows are "****", "* *", "* *", "****".
Exemplo 2
Entrada:
size = 1
Saída esperada:
expected = ["*"]
Entrada:
long long size = 1;
Saída esperada:
std::vector<std::string> expected = {"*"};
Entrada:
long size = 1;
Saída esperada:
string[] expected = new string[] {"*"};
Explicação
A 1×1 square is a single "*".
Referências
Este desafio foi adaptado para o CodeUtility. Siga o enunciado e as restrições acima.