Function to find Majority element in an array
function findMajority ( arr , n ) { var count1 = 0 , count2 = 0 ; var first = 2147483647 , second = 2147483647 ; = var flag = 0 ; for ( var i = 0 ; i < n ; i ++ ) {