A travel app lists the total journey times, in minutes, to several destinations using different road routes.
Each row represents one route. Each column represents the same destination across all routes. Times never decrease from left to right within a row or from top to bottom within a column. Equal times are allowed.
Return true if any listed journey takes exactly requiredTime minutes. Otherwise, return false.
boolean hasJourneyTime(List<String> travelTimes, int requiredTime)
travelTimes: one string per row, containing comma-separated journey times. For example, "14,27,43" represents three destinations on one route.requiredTime: the exact journey time to find, in minutes.travelTimes contains between 1 and 300 strings.1 and 300 integers.requiredTime is between 1 and 1,000,000,000, inclusive.hasJourneyTime(travelTimes = List.of("14,27,43,68", "20,34,51,79", "29,42,63,96"), requiredTime = 51)
Output: true
The second route reaches the third destination in exactly 51 minutes.
hasJourneyTime(travelTimes = List.of("9,23,38", "17,31,46"), requiredTime = 29)
Output: false
No listed journey takes exactly 29 minutes.
hasJourneyTime(travelTimes = List.of("18,18,33", "18,27,45"), requiredTime = 18)
Output: true
Several journeys take 18 minutes. Any one of them is enough.