Hi,
I recently appeared for Juspay OA, for SDE - 1. The round consisted of 3 Problems to be solved in the span of 90 mins. This one of the questions that I wasn't able to solve.
Problem Description :
You are given a maze with N cells. Each cell may have multiple entry points but not more than one exit (i.e. entry/exit points are unidirectional doors like valves). The cells are named with an integer from 0 to N-1.
You have to find :
Nearest meeting cell : Given any two cells - C1, C2, find the closest cell Cm that can be reached from both C1 and C2.
INPUT FORMAT :
OUTPUT FORMAT :
Output a single line that denotes the nearest meeting cell (NMC).
Sample Input :
23
4 4 1 4 13 8 8 8 0 8 14 9 15 11 -1 10 15 22 22 22 22 22 21
9 2
Sample Output :
4

The other 2 questions can be found here - https://leetcode.com/discuss/interview-question/2032859/Juspay-or-OA-or-Maximum-Weight-Node
https://leetcode.com/discuss/interview-question/1186405/largest-sum-cycle (Not My post).
Kindly upvote if you found this helpful.