No products are associated with this question.
Here is a hint:
a = 131245; b = 12; op = @(x)hidden_for_you_to_figure_out(x); pa = op(a); pb = op(b); isASub = false; %guilty until proven innocent for ii = pb:pa amii = mod(a,(10^ii)); if amii == b isASub = true; return; else for jj = 1:(ii-pb) afjj = floor(amii./(10^jj)); if b == afjj isASub = true; return; end end end end
All you have to do it figure out the contents of op().
Create a function that calculates the decimal expansion of a number in reverse order. mod() 10 gives the next digit to be output, integer division by 10, if the result is non-zero keep going.
Apply that to both numbers.
Now match the reversed n2 to the reversed n1.