I have written the code but it is not giving the correct answer.
link for the code :: https://ide.codingblocks.com/s/189912
I have written the code but it is not giving the correct answer.
link for the code :: https://ide.codingblocks.com/s/189912
You are not applying the concept of backtracking that is needed here.
You are just checking the all possibilities of last number and for starting number you are choosing only the first character.