cswork / OAOpen practice workspace

ZipRecruiterOA #12

Neighboring Record IDs

Estimated EasyStatement and editorial — judging is being prepared

Topics (AI-labelled)HashingStrings

You are given records in their current order. Each rec

Constraints

Record ids are unique.

Example 1

Input:

records = ["a|red","b|blue","c|green","d|yellow"]
queries = ["a","c","x"]

Output:

["None,b","b,d","None,None"]

Explanation: a has no previous id, c is between b and d, and x is not present.

Example 2

Input:

records = ["id7|one"]
queries = ["id7"]

Output:

["None,None"]

Explanation: A single record has no neighbors.

Editorial

Loading solution…