package leetcode;

/**
 * https://leetcode.com/problems/design-hashmap/
 */
public class Problem706 {
    private static class MyHashMap {
        private final Integer[] map = new Integer[1000001];

        /** Initialize your data structure here. */
        public MyHashMap() {
        }

        /** value will always be non-negative. */
        public void put(int key, int value) {
            map[key] = value;
        }

        /**
         * Returns the value to which the specified key is mapped, or
         * -1 if this map contains no mapping for the key
         */
        public int get(int key) {
            if (map[key] == null) {
                return -1;
            }
            return map[key];
        }

        /**
         * Removes the mapping of the specified value key if this map contains
         * a mapping for the key
         */
        public void remove(int key) {
            if (map[key] != null) {
                map[key] = null;
            }
        }
    }
}

@@ -154,23 +154,19 @@
 e final 
-I
+i
 nt
-eger
 %5B%5D map =
@@ -174,15 +174,11 @@
 new 
-I
+i
 nt
-eger
 %5B100
@@ -262,24 +262,118 @@
 HashMap() %7B%0A
+            for (int i = 0; i %3C map.length; i++) %7B%0A                map%5Bi%5D = -1;%0A            %7D%0A
         %7D%0A%0A 
@@ -698,85 +698,8 @@
 ) %7B%0A
-            if (map%5Bkey%5D == null) %7B%0A                return -1;%0A            %7D%0A
     
@@ -924,12 +924,8 @@
     
-if (
 map%5B
@@ -933,65 +933,13 @@
 ey%5D 
-!
 = 
-null) %7B%0A                map%5Bkey%5D = null;%0A            %7D
+-1;
 %0A   

Update problem 706