DIVGOLD - Editorial

Every language provides some fuctions to do such things. See http://www.cplusplus.com/reference/string/string/insert/ for C++.

1 Like

What will you do in “AAABAAA”?

This wont work for the following case OHH

I solved it with O(N^2) per test case during the contest itself.

Here is my solution link :slight_smile:
http://www.codechef.com/viewsolution/6562897

1 Like

@dpraveen

I tried the same approach, getting WA.
Here: CodeChef: Practical coding for everyone

hi @dpraveen could you please tell me where am i going wrong

you are correct my approach would give HOH .
but correct answer clearly seems to be HHO.

Hey can you please tell me why my solution is wrong.
This takes a lot less time and I have every test case I can think of but i am still getting the wrong answer.

Solution Link → CodeChef: Practical coding for everyone

can someone provide a test case ,where my code gives WA.
https://www.codechef.com/viewsolution/48036711
thanks in advance

@aakib_alam Try this

1
10
ZAEARIZGYX

(correct is AEARIZGYXZ)

Its shown an error on the while loop…