IBM interview question

LC medium-equivalent questions so typical for interviews