Problem F
Finding Ts
You have an image, given as a square grid of asterisks (*) and periods (.), and you want to know if it contains a T somewhere.
A letter T has a horizontal bar made of asterisks. The
number of asterisks is
If the image has a T, it contains only a single horizontal bar and a single vertical bar (connected as mentioned), and the only asterisks in the image are those belonging to these two bars.
Input
The first line contains
Output
The output is Y if the image contains a T; otherwise, it is N.
Sample Input 1 | Sample Output 1 |
---|---|
5 ..... ..*** ...*. ...*. ...*. |
Y |
Sample Input 2 | Sample Output 2 |
---|---|
4 .... ***. *... *... |
N |