Check if an array has a majority element
Given an array, the task is to find if the input array contains a majority element or not. An element is Examples: Input : arr[] = {2, 3, 9, 2, 2} Output : Yes A majority element 2 is present in arr[] Input : arr[] = {1, 8, 9, 2, 5} Output : No A simple solution is to traverse through the array. For