- Difficulty: Medium
- Tags: LeetCode, Medium, Recursion, Array, String, leetcode-247, Depth-First Search, O(n * 5^(n/2)), O(n), 🔒
Problem
Given an integer n
, return all the strobogrammatic numbers that are of length n
. You may return the answer in any order.
A strobogrammatic number is a number that looks the same when rotated 180
degrees (looked at upside down).
Â
Example 1:
Input: n = 2 Output: ["11","69","88","96"]
Example 2:
Input: n = 1 Output: ["0","1","8"]
Â
Constraints:
1 <= n <= 14