https://ide.codingblocks.com/s/244691 … plz give a hint where i am wrong .
All test cases not passing
@Gurankit_Pal_Singh
See while printing output, you have not change “{” again to space. So if final output have space in it, it’ll give wrong ans.
@Gurankit_Pal_Singh
Hey you have considered that input string only consist of space and lowercase alphabets but it’s not mentioned in the question. The input string might contain any alphabet including $,#,@,& etc.
I have modified your code and it is working fine for all testcases. Here is the code
thank you sir for resolving doubt…