My solution is here
ur solution fails for the following case:
Testcase:
1
aaaa aaaa
ur output: NO
actual output:YES
This is because the values of
- count1=16
- count2=4
Working code(with some editing): http://www.codechef.com/viewsolution/3243768
Other suggestions:
- there is an inbuilt function strlen() available to find the length of string
- add β\nβ to printf(βNOβ) in len1!=len2 condition
- u can solve this question by either sorting s1 and s2 then comparing them, or find the frequencey of each alphabet and compare them
1 Like
Thnx a lot.Itβs really helpful.
Happy to have helped