I am getting 2 failed test cases in today's (28 march) codebyte on hackerblocks

i tried for hours but i am not able to correct my code .
i am sharing the link of my code and queation…
question link :: https://hack.codingblocks.com/app/dcb/545
my code link :: https://ide.codingblocks.com/s/200293

PLEASE LOOK INTO IT…

Hi @vsinghal277

Your code is fails for test case like : aabb bbaa as we cannot convert B to A.
Instead of only counting and comparing frequencies, you need to check their relative positions also.

Hope it Helps.

Code for Reference : https://ide.codingblocks.com/s/200344