why its not passing any test cases although its running fine ???
Hashing highest freq
if(freq[a[i]]>ans){
ans=a[i];
}
this logic is completely wrong
you are comparing array element with freq
which will give wrong ans
why its not passing any test cases although its running fine ???
if(freq[a[i]]>ans){
ans=a[i];
}
this logic is completely wrong
you are comparing array element with freq
which will give wrong ans