Request for help with debugging my code


I am trying to solve the problem Name Reduction .

My Approach

I have input the names of the parents and counted the frequency of each alphabet in both the mom’s name and dad’s name counting them separately and stored in the array countp[]. Then I input the names of children n times in the same variable and stored the frequency of each alphabet in another array countc[]. I did this separately for every child. Now if at every position from 0-25 the value in countp[] is more than or equal to countc[] then the output should be yes, otherwise no. I have tried concatenating all the children’s name and then counting the frequency of each alphabet in that string but it still didn’t work. Can somebody please point out what’s wrong with my code?

Here is my submission link :