I can’t seem to find any error in my code but answer is wrong even for sample input. Kindly help.
Link to code : https://ide.codingblocks.com/s/199689
Finding CB numbers
hey @Chirag-Jain-1414278322030453 your conversion from string to integer is wrong, instead of num = num + ((test[len-1-k])*pow(10,k));, num = num + ((test[len-1-k] - ‘0’)*pow(10,k)); would come. Other than that it is mentioned in question that each character/digit can be used only once and your approach is wrong in that case.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.