Given a generic digital clock, having h number of hours and m number of minutes, the task is to find how many times the clock shows identical time. The parameters were 4 integers A,B,C,D. The valid time should be somewhere between 00:00 and 24:00. If the integers don't fulfil the requirements the function should return 0.
Restrictions: A,B,C,D are integers between [0,9]
public static int solve(int A, int B, int C, int D) {
//return the count of how many variants are there to combine the four integers so its a valid hour
// from 00:00 to 24:00
}
Testcase#1 (1,0,0,2) => (00:12) (00:21) (01: 02) (01:20) (02:10) (02:01) (10:02) (10:20) (12:00) (20:01) (20:10) (21:00) => should return 12
Testcase#2 (2,1,2,1) => should return 6
Testcase#3 (1,4,8,2) => should return 5
Testcase#4 (4,4,4,4) => should return 0