Microsoft interview question

leet code majority element question