Can anyone tell me what is wrong with my problem?
Here is problem statement LAPIN Problem - CodeChef
Here is my code CodeChef: Practical coding for everyone
You are using sum as the comparing logic which is not the correct approach. Try it for these strings:
adxbc
iljk
wzaxy
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.