I created a code to print the largest number from a given input but it is only valid for inputs containing distinct digits and gives an error \'string index out of range\' w