Return the largest 1 to 9 pandigital 9-digital number that can be formed as the concatenated product of an integer with (1,2,...,n) where n > 1.
()
| 56 | |
| 57 | |
| 58 | def solution() -> int | None: |
| 59 | """ |
| 60 | Return the largest 1 to 9 pandigital 9-digital number that can be formed as the |
| 61 | concatenated product of an integer with (1,2,...,n) where n > 1. |
| 62 | """ |
| 63 | for base_num in range(9999, 4999, -1): |
| 64 | candidate = 100002 * base_num |
| 65 | if is_9_pandigital(candidate): |
| 66 | return candidate |
| 67 | |
| 68 | for base_num in range(333, 99, -1): |
| 69 | candidate = 1002003 * base_num |
| 70 | if is_9_pandigital(candidate): |
| 71 | return candidate |
| 72 | |
| 73 | return None |
| 74 | |
| 75 | |
| 76 | if __name__ == "__main__": |
no test coverage detected