Implement a playlist shuffle with no or minimal adjacent songs by the same artist.
Unlock detailed company stats for this questionUpgrade
Given a playlist of songs, implement a shuffle function such that there are no (or minimal) adjacent songs by the same artist. using Song = pair<string, string>; // (artist, song). void shuffle(vector<Song>& playlist). Example input: [(A, apple), (A, banana), (B, orange), (B, guava), (C, mango)] gives output order ABABC.
Format · Google L4 phone screen, December 24, 2025.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
