IBM Interview Question

LC medium-equivalent questions so typical for interviews