Treasure Rooms Reachable from Any Room in DAG
Asked at Karat · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026
Given a 2D array representing which room can see other rooms, and a set of integers representing treasure rooms, return all treasure room IDs that can be visited from any room.
Loading the problem…
More Karat interview questions
- Find String Path in Grid Moving Only Right or Down
- Calculate Department Visit Difference for Shopping Lists
- Find Valid Rooms
- Bus Schedule Management with Priority Boarding
- Assign people to cars based on shortest travel time from two start points.
- Find Word with Anagram Present in Given String