Amazon Interview Question

DP question Numbers With Repeated Digits