Microsoft Interview Question

leet code majority element question