function moreThanHalf(nums) {
let numsLength = nums.length
const result = {};
nums.forEach((element) => {
if(result[element]) {
result[element] =result[element] + 1;
}
else {
result[element] = 0 + 1;
}
})
let ans = 0;
for(let i in result){
console.log(result[i]);
if(result[i] > (numsLength/2)){
return i-0;
}
}
}