Advarra interview question

Easy method DS and algo Oops basic questions