Skip to main content
Strobogrammatic Number II | AlgoCracked
AlgoCracked
ProblemsStrobogrammatic Number II
Medium50.0% acceptance
ArrayStringRecursionBacktracking

Strobogrammatic Number II

A strobogrammatic number looks the same after being rotated 180° (turned upside down). Under that rotation only these digit mappings are valid: 0↔0, 1↔1, 8↔8, and the pair 6↔9. Given an integer n , return all strobogrammatic numbers with exactly n digits, each as a string. When n 1 a number may not have a leading zero. The results may be returned in any order . Input format Input is [n] , e.g. [2] .

Loading workspace…