INFOTECH Coding Question – Solved

4 Live
Question: The kingdom has been given terrible news: the King has passed away. While the nation is mourning, the noblemen need to decide who will take the throne next. The late King had many children, and now it is necessary to determine their order of succession according to their seniority. The list of the King's children is represented as a table "Successors" with the following attributes: - name: the child's name - birthday: the date of their birthday (it is guaranteed that birthday dates are unique) - gender: their gender (a character equal to 'M' or 'F') The resulting table should contain the names of the King's heirs in order of their succession to the throne as determined by their age, and preceded by their potential future titles (i.e. "King name" or "Queen name"). Example: For the following table "Successors": | name | gender | birthday | |--------|--------|------------| | Amelia | F | 1711-06-10 |

Asked in: INFOTECH

Image of the Question

Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |