public class Solution {
    public boolean isStrobogrammatic(String num) {
        if(num == null || num.length() == 0) return true;
        HashMap<Character, Character> map = new HashMap<Character, Character>();
        map.put('0', '0');
        map.put('1', '1');
        map.put('8', '8');
        map.put('6', '9');
        map.put('9', '6');
        
        int start = 0;
        int end = num.length() - 1;
        while(start <= end) {
            char temp1 = num.charAt(start);
            char temp2 = num.charAt(end);
            if(map.containsKey(temp1) && map.get(temp1) == temp2) {
                start++;
                end--;
                continue;
            }
            return false;
        }
        return true;
    }
}