Google interview question

Data structure and algorithms coding challenge.