Majority Element
Majority element is an element that appears more than n/2 times in an array of length n. Write a function that finds and returns the majority element in an array. If there is no majority element, return -1. The input will be a single string of integers separated by spaces.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)