it is giving tle
Help me out in this problem
Yes i am understanding question and your logic. Be patient
In the output format, every answer should be in a new line. Add endl while printing your string f. And submit it, it might get accepted.
It might be some error in the logic. Let me omit your code and I’ll share it with you .
@shivammishra20121999 see this code https://ide.codingblocks.com/s/362536
i have added comment to, what was wrong with your code was not handling string stl properly. And also your logic wasn’t correct i have edited your code here https://ide.codingblocks.com/s/362539
what i have edited in your code was if statement in your first for loop , i wasn’t able to understand your logic so when i have given an input of second example in the given question it wasn’t giving the correct output.