Toshiba Hiring Challenge | Problem Destination City | Off-Campus OA (2022)
Toshiba · Question · Posted Jun 2026
Problem Statement You are given a list of paths where paths[i] = [cityA, cityB] represents a direct path from cityA to cityB. Return the destination city, which is the city that has no outgoing path. Example Input paths = [["London","New York"],["New York","Lima"],["Lima","Sao Paulo"]] Output Sao Paulo Test Cases Test Case 1 Input paths = [["A","Z"]] Output Z Test Case 2 Input paths = [["B","C"],["D","B"],["C","A"]] Output A
The full answer & interview discussion are available to premium members.
Log in Create a free account