Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 75. Sort Colors
Reorder an array of values 0, 1, and 2 in-place so all 0s come first, then 1s, then 2s (the Dutch National Flag problem); aim for a one-pass, constant-extra-space solution without using built-in sort.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late October, 2024
Amazon
Junior
Sort 0, 1, 2 (optimized to O(1) space and O(n) time)
Early October, 2024
Intern
Color n houses with k colors where no adjacent houses can have the same color, given that the colors of the first and last houses are fixed
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.