Not passing all test cases can you please tell me what is wrong
Hi @Rajat-Sharma-2078329489142103
In your code when there is zero at the end of input then your code is printing each string two times. Like if input is 10 then your code output is :
.
.
+
+
@
@
$
$
but the correct output should be :
.
+
@
$
And also when 0 is in between two digits in input then your code is not printing space corresponding to table[0] string. So there is no use of that if statement because when d==0 then table[0] contains " " (space).
So just remove that if statement then all your test cases will pass. And also remove last line of your code that is cout<<‘0’-‘0’; which is of no use.
Here is your corrected code :
https://ide.codingblocks.com/s/176166
If your doubt is clear then mark it as resolved.
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.