Algoworks interview question

Milk jar puzzle