仕事
ラッパー要素とギザギザのない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","."],
[".",".",".",".",".","."]],
[[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."],
[".",".",".",".",".","."]]]
または、4文字の文字列の2行2列の配列を指定します
[["Your",
"gift"],
["goes",
"here"]]
そして、文字"."
、6文字の文字列の4行4列の配列に答えます
[["......",
"......",
"......",
"......"],
["......",
".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]]]