@@ -0,0 +1,472 @@
+# 4 digits, only 24 permutations. Brute force is much more straightforward than tailored code to construct the max time.%0A%0Afrom itertools import permutations%0A%0Adef is_valid_time(A):%0A    return 10*A%5B0%5D+A%5B1%5D %3C= 23 and 10*A%5B2%5D+A%5B3%5D %3C= 59%0A%0Adef format_time(A):%0A    return %22%7B%7D%7B%7D:%7B%7D%7B%7D%22.format(*A)%0A%0Aclass Solution:%0A    def largestTimeFromDigits(self, A: List%5Bint%5D) -%3E str:%0A        return max((format_time(perm_A) for perm_A in permutations(A) if is_valid_time(perm_A)), default=%22%22)%0A

949. Largest Time for Given Digits