Maximum Cities Visited Traveling West to East with Lexicographic City Names

Asked at Upstart · Coding Questions · Difficulty: Medium

You are given `n` cities. Each city has a name `names[i]` and an east-west coordinate `x[i]` (smaller = farther west, larger = farther east).

Loading the problem…