Self dividing number

it is a number that is divisible by every digits it contains.
eg 128 (128%1==0,128%2==0,122%8==0)
it should not contain zero

given lower and upper bound , output the list of every possible self dividing number , including the bound.

input
left=1
right=22

output
1,2,3,4,5,6,7,8,9,11,12,15,22

cpp solution must ,

this is a very easy problem
use brute force approach
time limit is not problem in this case

have you tried it atleast once??

Solve it with brute force. Iterate each number between left and right. For each number, convert it to string and check whether it contains ‘0’. If it contains, ignore it. If not, iterate each digit and check whether the number can be divided by all digits.

even if you have some problem in implementation or didn’t understand anything feel free to ask
i will also provide the cpp solution

I did try but didnt get it, now soln in cpp please

Reference Code

a good advice for you
solution never improve programming skills
you have to make your own solutions to improve your own coding skills

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.