Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1122. Relative Sort Array
Reorder arr1 so its elements follow the relative order given by arr2 (keeping duplicates together), and place elements not in arr2 at the end in ascending order. Typically solved by counting frequencies (or a hash map) to emit elements in arr2 order then output remaining values sorted.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.