Introduction
Sometimes, my boxes are too small to fit anything in it. I need you to make a box expander! So, what makes a box a box in this challenge.
OOOO
O O
O O
O O
OOOO
The corners of the box are always spaces. The box itself can be made out of the same character. That character can be any printable ASCII character, except a space. So, that's these characters:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
The side lengths of the box above are 4, 3. You may assume that the side length is always positive. That means that this is the smallest box you need to handle:
#
# #
#
In order to expand a box, you need to increment each side length. Let's go through this, step by step, with the above example. We first take the upper side of the box, which is:
OOOO
We expand this by one, so we get:
OOOOO
This is the upper and lower part of the box now. After that, we do the same with the sides on the left and right:
O
O
O
Becomes:
O
O
O
O
Now we reassemble the box, which results into:
OOOOO
O O
O O
O O
O O
OOOOO
The task
Given a box, expand it by 1. The box can be given in multiple lines, or in an array.
Test cases
OOOO OOOOO
O O > O O
OOOO O O
OOOOO
XXXXXX XXXXXXX
X X > X X
X X X X
XXXXXX X X
XXXXXXX
~ ~~
~ ~ > ~ ~
~ ~ ~
~~
This is code-golf, so the submission with the least amount of bytes wins!