RavenPack interview question

Solve the alphabet soup problem and explain your solution using Big 0 notation