Object-Oriented Programming · Amazon · Medium
Requirements Method 1 — ingest(user, songs[]): add a supplied group of songs, with counts continuing to grow across separate batches. Method 2 — next(): choose the most frequent song that has not already been selected during the active cycle. After each unique song has been selected once, clear the selected-song tracking so that a later call can choose any song again. Explain the runtime of both methods and establish how equal frequencies are resolved (lexicographic order or…
Checking your access…