Select your answers. Once selected, you cannot change them.
Given an array of integers, return the element that appears more than n/2 times. If no such element exists, return -1.
Example: Input: [3,3,4,2,4,4,2,4,4]
→ Output: 4
Write your solution below: