Help with a problem - LAPIN

Can anyone tell me what is wrong with my problem?
Here is problem statement
Here is my code

You are using sum as the comparing logic which is not the correct approach. Try it for these strings:


These should be NO but give output as YES because according to your code,
sum(ad) = sum (bc)
sum(il) = sum(jk)
sum(wz) = sum(xy)

Hope you understand the mistake.

1 Like

i didn’t considered all the possibilities, yes i got it.