PhonePe Interview Question

DSA array and graph question (Mid level)