Algorithm · Microsoft · Medium
You are given four integers: A, B, C, and D. Each integer is a single digit (0–9). Your task is to find out how many distinct valid times on a 24‑hour digital clock can be formed by using all four digits exactly once. The clock format is HH:MM. A time is considered valid if the hours HH are between 00 and 23 inclusive, and the minutes MM are between 00 and 59 inclusive. Constraints: A, B, C, and D are integers in the range [0, 9]. Example 1: Input: A = 1, B = 8, C = 3, D = 2…
Checking your access…