Back to problems

Rooms with Two Incoming Edges to Treasure

Algorithm · SoFi · Easy

Requirements Inputs are string[][] instructions_room and string[] treasure_rooms. A pair [a, b] in instructions_room represents a directed connection from room a to room b. Return a List containing every room that meets both of these requirements: it has incoming connections from at least two rooms; one of its outgoing connections leads directly to a treasure room. Rooms named as treasures are also present in the instruction data, and treasure_rooms is allowed to be empty. A…

Checking your access…