The question is 459C.
I have understood the logic behind it. But, in order to generate the possible permutations, I am using DFS.
It gives a WA on test 7, saying that my code prints ":". But, I am not printing ":" anywhere in my code.
Any help would be really appreciated.
You are appending ch to s and the max value of ch is '1'+k-1 :/
In the given test case the value of k is 1000000000. So....adding that value to '1' will give unexpected results. Remember '1' is not a number, its a char with ASCII value 49. So, you are getting something with ASCII value 1000000049. Since, char has lesser memory, it just cycles and stops at 58, which is ":"
Thank you so much!