A strobogrammatic number is one that looks the same when rotated 180 degrees. Given a string num, return whether it is strobogrammatic.
Check pairs from outside in. Valid strobogrammatic digit pairs: (0,0),(1,1),(6,9),(8,8),(9,6). Middle digit (if odd length) must be 0, 1, or 8.
- Two pointers lo=0, hi=n-1.
- Check if (num[lo], num[hi]) is a valid strobogrammatic pair.
- Middle element (lo==hi) must be 0, 1, or 8.
- Time Complexity: O(N)
- Space Complexity: O(1)