Increments the count for hash.
hash
int incrementHash(int hash) { if (hashes.containsKey(hash)) { hashes[hash] = hashes[hash]! + 1; } else { hashes[hash] = 1; } return hashes[hash]!; }