Algorithm · Upstart · Medium
Problem Description You are given n cities. For each city you know: its name, names[i] its east-west coordinate, x[i] (a smaller value means farther west, a larger value means farther east) You plan a trip from west to east. Every move from your current city to the next must satisfy two rules: The next city lies strictly east of the current one: x[next] > x[cur] The next city's name is strictly greater in lexicographical order: names[next] > names[cur] You may begin at any…
Checking your access…