Two test cases got failed

@Pranav_Chaudhary
You should compare arr[i] with arr[max] and not just max. You are just storing the index of character occuring most frequently in max.

if(arr[i]>arr[max]) {
max=i;
}