Given a series of o
s representing dots, connect them vertically or horizontally
Examples
Input:
o o
o
Output:
o---o
|
|
o
Input:
o o o
o
Output:
o---o----o
|
o
Spec
If you want the input padded with spaces to form a rectangle, please specify this in your answer
There will only be
o
, spaces, and newlines in the input- There will always be a pair of dots to connect
- No two
o
s will be directly adjacent - Dots should be connected with
|
and-
, for vertical and horizontal connections respectively - No dot connections will overlap