PhonePe SDE OA | 2024 | Repainting Luna's Socks, Teleportation Caves Labyrinth & Scout Cookie Maximization

PhonePe · Question · Posted Jun 2026

Problem 1 - Repainting Luna's Socks Problem Statement Luna has n socks numbered from 1 to n. Each sock initially has a color c[i], where colors are numbered from 1 to k. For the next m days, Luna's mother specifies a pair of socks that Luna must wear together. On day j, Luna must wear socks (u[j], v[j]). To avoid a fashion mismatch, Luna wants both socks worn on the same day to have exactly the same color. She may ...

The full answer & interview discussion are available to premium members.

Log in Create a free account