But if you change the base '10' into base 'n' ,then each digit for every no. in the range will be 3.
So if d=constant , time complexity = 0(constant.(n+n)) : 1st 'n' is the no. of elements , 2nd 'n' is the range of each digit.
So time complexity= 0(n).