Ebryx interview question

Problem solving questions from leet code