Find grandpa's grave
Statement
Goal
You find yourself exploring a place, looking for your grandfather's grave.Given a particular layout, output your chance to find it with only one try.
The place you're exploring is delimited by symbols -, +, and | as follows:
+--+
| +|
| ||
+--+
As you can see, each grave you'll be able to find inside this area is represented by a + with a | below.
You have to count the graves and give the chance (percentage, rounded) that, if you pick any of them, it will be the one you're looking for.
Input
Line 1 : An integer n, for the graveyard's size.
n next lines : A string representing a line of the graveyard.
n next lines : A string representing a line of the graveyard.
Output
Line 1 : Chance (%) to find grandpa's grave directly, rounded.
Constraints
3 < n < 50
Example
Input
5 +---+ |+ | || | | | +---+
Output
100%
Game modes
Fastest, Shortest
Test cases
One grave Test
Input
5
+---+
|+ |
|| |
| |
+---+
Output
100%
Validator 1 Validator
Input
4
+--+
| +|
| ||
+--+
Output
100%
Several graves Test
Input
6
+----+
|+ |
|| +|
| +||
| | |
+----+
Output
33%
Validator 2 Validator
Input
7
+-----+
| |
|+ |
|| +|
| ++||
| || |
+-----+
Output
25%
Crowded graveyard Test
Input
10
+--------+
| ++ + |
| || +| |
|+ + | |
|| | +|
| + + ||
| +| | |
|+|+ +++ |
|| | ||| |
+--------+
Output
7%
Validator 3 Validator
Input
11
+---------+
| ++ + |
| || +| |
|+ + | |
|| | +|
| + + ||
| +| | |
|+|+ +++ |
|| | ||| +|
| ||
+---------+
Output
6%
Is this even a graveyard ? Test
Input
12
+----------+
| o |
| \|/ |
| / \ |
| |
| o |
| -|- |
| / \ |
| o |
| /|\ |
| / \ |
+----------+
Output
0%
Validator 4 Validator
Input
7
+-----+
| |
| |
| |
| |
| |
+-----+
Output
0%
Solution language
Solution
Stub generator input