247. Strobogrammatic Number II
https://www.lintcode.com/problem/strobogrammatic-number-ii/description
https://leetcode.com/problems/strobogrammatic-number-ii
Intuition
All possible combinations => DFS
Fill in the string from two ends
Terminate recursion when i reaches (n + 1) / 2
Skip 6, 9 for midpoint of odd length string
Skip 0 for > 1 length string
----https://leetcode.com/problems/strobogrammatic-number-ii
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
Find all strobogrammatic numbers that are of length = n.
Example:
Input: n = 2
Output: ["11","69","88","96"]
---Intuition
All possible combinations => DFS
Fill in the string from two ends
Terminate recursion when i reaches (n + 1) / 2
Skip 6, 9 for midpoint of odd length string
Skip 0 for > 1 length string
Time - O(N)
Space - O(N)
---
Related problems
---
---
---