Microsoft interview question

Problem solving for leetcode (medium problems )