Search
⌘K

Leetcode 247. Strobogrammatic Number II

Generate all length-n strobogrammatic numbers—strings that appear identical when rotated 180°—by constructing valid digit pairs (0-0,1-1,6-9,8-8,9-6). The core challenge is using recursion/backtracking to place pairs from the outside in while avoiding leading zeros for n>1 and handling the single middle digit when n is odd.

Asked at:

Uber


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late September, 2025

Uber

Staff

# rotationally_symmetrical of len 1 is [0, 1, 8] # rotationally_symmetrical of len 2 is [11, 88, 69, 96] # rotationally_symmetrical of len 3 is ['101', '111', '181', '609', '619', '689', '808', '818', '888', '906', '916', '986']

Comments

Your account is free and you can post anonymously if you choose.