IBM interview question

medium and easy LC questions