A simple Iterative Backtrack method for the 10 digit problem using Python.
Note: Range is different for each digit because of the domain reduction, having self.number_of_digits in all range functions would also yeild same solution but takes longer time and consumes more memory hence we go for Iterative rather than Recursive approach.