Given a rectangular matrix of characters, add a border of asterisks(*
) to it.
Example
For
picture = ["abc",
"ded"]
the output should be
solution(picture) = ["*****",
"*abc*",
"*ded*",
"*****"]
Input/Output
-
[execution time limit] 3 seconds (java)
-
[memory limit] 1 GB
-
[input] array.string picture
A non-empty array of non-empty equal-length strings.
Guaranteed constraints:
1 ≤ picture.length ≤ 100
,
1 ≤ picture[i].length ≤ 100
. -
[output] array.string
The same matrix of characters, framed with a border of asterisks of width
1
.
[Java] Syntax Tips
-
CodeSignalSolutions/Add_Border/Add_border.js
Lines 1 to 13 in 6387cc4
-
CodeSignalSolutions/Add_Border/Add_border.java
Lines 17 to 28 in 6387cc4