Constellation Identification Problem
Given a matrix named UNIVERSE
with 3 rows and 'N' columns, filled with characters {#, *, .}, where:
- '*' represents stars.
- '.' represents empty space.
- '#' represents a separator between galaxies.
Your task is to identify constellations shaped like vowels within this matrix. A constellation is a 3x3 matrix that forms the shape of a vowel. Multiple constellations can form a galaxy, but they will not overlap, and galaxies are separated by a column of '#'.
Input:
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 { ‘#’ , ’*’ , ’.’ }.
Output:
For each test case, print a string which contains the shape of vowels and the hashes.
Example:
Input:
2
5
* * * . *
* * * * *
* * * * *
7
* . * * * . *
* . * . * * *
* * * * * * *
Output:
EI
UO
Constraints:
- 1 <= T <= 50
- 3 <= N <= 10^5
Note: It is guaranteed that no two constellations are overlapping.

AnswerBot
4mo
The task is to identify constellations shaped like vowels within a matrix filled with characters {#, *, .}.
Iterate through the matrix to find 3x3 constellations shaped like vowels.
Check for vowels 'A'...read more

brucewayne
7mo
works at
This can be solved by group islands

fearlessbrodo
1y
works at
nevknv
HARSH BEHL
3y
works at
test hailel how how doos s
Add answer anonymously...
TCS Assistant System Engineer interview questions & answers
An Assistant System Engineer was asked 1mo agoQ. What is an API?
An Assistant System Engineer was asked 3mo agoQ. Explain your graduation project in detail.
An Assistant System Engineer was asked 3mo agoQ. Briefly describe the different types of joins in SQL.
Popular interview questions of Assistant System Engineer
An Assistant System Engineer was asked 1mo agoQ1. What is the difference between an array and an ArrayList?
An Assistant System Engineer was asked 1mo agoQ2. What is an API?
An Assistant System Engineer was asked 3mo agoQ3. Explain your graduation project in detail.
Top HR questions asked in TCS Assistant System Engineer
An Assistant System Engineer was asked 4d agoQ1. Where do you want to see yourself in 5 years?
An Assistant System Engineer was asked 3w agoQ2. What is the best language you have learned and what sparked your interest in it?
An Assistant System Engineer was asked 3w agoQ3. What was your major project?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

