← Morgan Stanley questions
CodingReported in a candidate post, Jul 2025

Sort (value, color) pairs by color, then by value

Filed under Morgan Stanley

You are given (value, color) pairs. Case 1: the pairs are already sorted by value; reorder them by color without changing the relative order of values within a color. Case 2: the values are unsorted…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.