Lev interview question

A take home assignment involving sorting and digesting brackets in a string