Skip to main content
3 of 5
added 5 characters in body
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 39 38 bytes

(' ',|.){~[:(>.*=+.*e.,)"0/~|@i:&.<:@#

Try it online!

Consider over:

First imagine a table of coordinates like:

┌───┬───┬───┬───┬───┬───┬───┐
│4 4│4 3│4 2│4 1│4 2│4 3│4 4│
├───┼───┼───┼───┼───┼───┼───┤
│3 4│3 3│3 2│3 1│3 2│3 3│3 4│
├───┼───┼───┼───┼───┼───┼───┤
│2 4│2 3│2 2│2 1│2 2│2 3│2 4│
├───┼───┼───┼───┼───┼───┼───┤
│1 4│1 3│1 2│1 1│1 2│1 3│1 4│
├───┼───┼───┼───┼───┼───┼───┤
│2 4│2 3│2 2│2 1│2 2│2 3│2 4│
├───┼───┼───┼───┼───┼───┼───┤
│3 4│3 3│3 2│3 1│3 2│3 3│3 4│
├───┼───┼───┼───┼───┼───┼───┤
│4 4│4 3│4 2│4 1│4 2│4 3│4 4│
└───┴───┴───┴───┴───┴───┴───┘

For each element, ask "Are they equal or does either equal one" =+.*e.,? The answer will be 1 if true, 0 otherwise. Multiply that answer by the max of the two numbers >.*:

4 0 0 4 0 0 4
0 3 0 3 0 3 0
0 0 2 2 2 0 0
4 3 2 1 2 3 4
0 0 2 2 2 0 0
0 3 0 3 0 3 0
4 0 0 4 0 0 4

Now just index into the original input, reversed, with a space appended (' ',|.){~:

o  o  o
 v v v 
  eee  
overevo
  eee  
 v v v 
o  o  o
Jonah
  • 33.8k
  • 4
  • 40
  • 94