Question d’entretien chez Microsoft

Leetcode problems so make you practice. Also, explain your reasoning behind it.