https://hack.codingblocks.com/app/dcb/1551
why it was showing wrong output,and is there any optimized solution than this
Hacker block daily problem
Simply make the hash of 256 characters for both the strings and then give the sum of differences of frequencies at each location.
i.e
For(int i=0;i<256;i++)
ans += abs(A[i]-B[i])
where A and B contains frequencies of characters with in str1 and str2 respectively.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.