
. * .
* * *
* . *
* * *
* * *
* * *
* * *
. * .
* * *
* * *
* . *
* * *
* . *
* . *
* * *
It is guaranteed that no two constellations are overlapping.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first line of each test case contains a single integer ‘N’ denoting the number of columns in the matrix.
The next 3 lines of each test case denote the matrix of size 3 rows and ‘N’ columns which denotes the stars and the galaxies. Each line contains ‘N’ space separated characters from the set { ‘#’ , ’*’ , ’.’ }.
For each test case, print a string which contains the shape of vowels and the hashes.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 50
3 <= N <= 10^5
Time Limit: 1 sec
The key idea is to recursively check every 3x3 grid and see what vowel does it signify and it to the string. This can be easily done using a recursive function.
Here is the algorithm :
The key idea is to just check every 3x3 grid and see what vowel does it signify and it to the string. This can be easily done iterating through the matrix with the help of a loop.
Here is the algorithm :