Checks whether n is a 9-digit 1 to 9 pandigital number. >>> is_9_pandigital(12345) False >>> is_9_pandigital(156284973) True >>> is_9_pandigital(1562849733) False
(n: int)
| 42 | |
| 43 | |
| 44 | def is_9_pandigital(n: int) -> bool: |
| 45 | """ |
| 46 | Checks whether n is a 9-digit 1 to 9 pandigital number. |
| 47 | >>> is_9_pandigital(12345) |
| 48 | False |
| 49 | >>> is_9_pandigital(156284973) |
| 50 | True |
| 51 | >>> is_9_pandigital(1562849733) |
| 52 | False |
| 53 | """ |
| 54 | s = str(n) |
| 55 | return len(s) == 9 and set(s) == set("123456789") |
| 56 | |
| 57 | |
| 58 | def solution() -> int | None: |