20th Nov 2020, 2:51 PM
Rhea Rajput
Rhea Rajput - avatar
3 Answers
+ 4
On like 32 pw.at(i)==numbs[j] you are comparing a number's ASCII value to an integer which will always equate to false. here is the fix👇 https://code.sololearn.com/c20ipUAq5Cl5/?ref=app
20th Nov 2020, 3:12 PM
Arsenic
Arsenic - avatar
+ 3
A 'char' digit is not the same as an 'int' digit. '1' == 1 would be false because if you look at an ascii table you'll see that the integral representation for the character '1' is actually 49. You probably want to change your numbs array to '0' to '9' instead of 0 to 9.
20th Nov 2020, 3:14 PM
Dennis
Dennis - avatar
+ 1
Arsenic Dennis Thank you so much!
20th Nov 2020, 3:53 PM
Rhea Rajput
Rhea Rajput - avatar