Quick Overview

Rearrange the characters of a target string so they follow the order given by a second string, placing characters not in that order at the end in their original relative order. Tests custom sort keys, counting, and stable handling of unranked characters.

Sort a String's Characters by a Given Character Order

Company: Waymo

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Rearrange the characters of a target string so they follow the order given by a second string, placing characters not in that order at the end in their original relative order. Tests custom sort keys, counting, and stable handling of unranked characters.

Loading…