Citi interview question

blak red tree