Https://ide.codingblocks.com/s/117438

why is this not passing all test cases?

Your code is failing in this kind of test case : aaaabbccccaaaabcbacba
Your output is : aabccaabcbacba
Expected output is : abcabcbacba