任务
给定一个包装器元素和一个非锯齿状的3D数组,将数组顶部,底部和四周包裹起来。您必须同时处理字符数据和数字数据,但是包装器和当前数据将具有相同的数据类型。
角色示例
对于字符数据,您可以选择处理单个字符的3D数组或字符串的2D数组:
给定2层2行4列字符数组
[[["Y","o","u","r"],
["g","i","f","t"]],
[["g","o","e","s"],
["h","e","r","e"]]]
和字符"."
,回答4层,4行,6列字符数组
[[[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".","Y","o","u","r","."],
[".","g","i","f","t","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".","g","o","e","s","."],
[".","h","e","r","e","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."]]]
或给出2行2列的4个字符的字符串数组
[["Your",
"gift"],
["goes",
"here"]]
和字符"."
,回答4行4列的6个字符的字符串数组
[["......",
"......",
"......",
"......"],
["......",
".Your.",
".gift.",
"......"],
["......",
".goes.",
".here.",
"......"],
["......",
"......",
"......",
"......"]]
数值示例
给定2层2行2列数字数组
[[[1,2],
[3,4]],
[[5,6],
[7,8]]]`
和数字0
,回答4层,4行,4列数字数组
[[[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]],
[[0,0,0,0],
[0,1,2,0],
[0,3,4,0],
[0,0,0,0]],
[[0,0,0,0],
[0,5,6,0],
[0,7,8,0],
[0,0,0,0]],
[[0,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]]