Sort names given a permutation using first or last names
Filed under Goldman Sachs
The question
Given a list of names with first and last names and a permutation of their indices, determine if the names can be sorted by choosing either the first or last name for each entry according to the permutation sequence.
No write-up yet. Related questions below have one.
Related Goldman Sachs questions
Collected from public candidate posts and coding forums. Updated Nov 2026.