Loading...
Loading...
Given an integer n, return the license plate at index n (0-indexed) in the sequence described below.
Every plate has 5 characters. The sequence is the concatenation of six ranges, in this order:
00000 to 99999.A0000 to Z9999.AA000 to ZZ999.AAA00 to ZZZ99.AAAA0 to ZZZZ9.AAAAA to ZZZZZ.Inside a range, plates are in increasing order, with the leftmost character changing slowest. Letters are uppercase and go from A to Z. Digits go from 0 to 9.
Note that each range has a fixed number of letters followed by a fixed number of digits. For example, 12CD5 is not a valid plate.
If n is past the last plate in the sequence (ZZZZZ), return an empty string.
0 <= n <= 2 ** 31 - 1The first range starts at index 0 with 00000, so index 5 is 00005.
The all-digit range has 100000 plates, so index 100000 is A0000 and index 100003 is A0003.
The sequence has 19244736 plates in total, so the last valid index is 19244735 and index 19244736 is past the end.