The problem states that there are some random digits given as input and we have to find the maximum date and time in the format MM/DD HH:MM. Ex:
Input is: 2,2,3,1,3,3,3,5,6,2,0
Output is: 12/30 23:56
I tried the brute force method where each digit is combined with every other digit to form a 2 digit number and so on. But the whole program had around 8 or 9 for loops. Is there a more efficient way to do this??
Edit1: If no possible month or date or time can be formed then the output must be 0. There is no auto insertion of 0s i.e. if you want to form a month 09 then 0 has to be in input and there cannot be repetition of digits.