- 0of 0 votes
Q1. F2F Round 1 Amazon(Bangalore)- Nitin Gupta May 12, 2012 in India
Given a character array as input. Array contains only three types of characters 'R', 'G' and 'B'. Sort the array such that all 'R's comes before 'G's and all 'G's comes before 'B's.
Constraint :- No extra space allowed(except O(1) space like variables) and minimize the time complexity.
You can only traverse the array once.
| Report Duplicate | Flag | PURGE
Interview Type: Written Test
Open Chat in New Window