PLS HELP! my code is giving WA (REARRSTR)

codechef.com/viewsolution/36210346
I hv first found the max freq element then i hv calculated max no. of gaps possible between 2 such element then i hv filled all elements with this gap whenevr an empty index is found.

Try Solving this question using std::count() . Compare the frequencies of each key and the length of the given string .

1 Like

Your code is failing on the test case
1
aaaabbccdd
The correct answer is
ababacadcd
or something of this pattern

1 Like