DICGOLD-wrong answer

Link to my solution for the problem DIVGOLD. kindly help me in finding the error to this problem!

the initial error which I can see is -
test case==> DBAC
expected output ==>ADBC
your output==>CDBA
now try to check for error.
And also it is DIVGOLD not DICGOLD lol.