I am asked to provide the asymptotic space and time complexity of the below algorithm in appropriate terms for an initial input number of arbitrary length (as distinct from a constant 12 digits).
1 for i = 2 to 12
2 if d[i] == d[i-1]
3 d[i] = (d[i] + 3) mod 10
This algorithm is apply for a number that has 12 digits, each digit is stored in the array d[] (so we have d[1], d[2],... d[12])
I figured out the time complexity is O(n) but how do I determine the space complexity?