69 and 818 are flip-proof, while 16 is not.
Return every flip-proof number of length length as a string. Numbers have no leading zeros: the first digit cannot be 0 unless the number is a single digit. The order of the answer doesn't matter.length=1 → ['0', '1', '8']
Among single digits only 0, 1 and 8 stay themselves after the turn.
length=3 → ['101', '808', '609', '906', '111', '818', '619', '916', '181', '888', '689', '986']
The outer digits are one of the pairs 1…1, 8…8, 6…9, 9…6, and the middle is 0, 1 or 8: 4 · 3 = 12 numbers.
length=1
['0', '1', '8']
Run checks the first 3 tests in your browser. Submit checks all 11 tests on the server, hidden ones included.