Arrays

Majority Element

easy
Given an array `nums` of size n, return the majority element — the element that appears more than ⌊n/2⌋ times. You may assume it always exists.
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.