My solution https://www.codechef.com/viewsolution/13536321
Just want to know for which test cases I am getting WA (I am not concerned with TLE as I am using brute force approach)
You should remove duplicates before printing
@rdfan19…after you read char and then site_name, instead of splitting them by space, split them by space or newline…What I mean is input files at codechef server may not be well formatted…Give it a try and let me know.
Printed the length of ‘str’ to check if it is picking only the desired string or something extra but it seems to get the correct string.Can you please elaborate what you meant.
Please look at my submission.I have done that in an easy way using hashing and let me know if you have any doubt
I am not familiar with c++ STL. Just curious to know for what input does my code gives Wrong Answer.I Will definitely try different approach to solve this question.