Data Structure and Algorithm 8 | Hashtable

0_QXrDY4nVmhZ1umbX

1. Hashtable

(1) Hashset Implementation

Design a hashset.

Leetcode 75.

(2) Hashset Implementation

Design a hashmap.

Leetcode 75.

(3) Single Number

Find the only number appeared once.

Leetcode 136.

(4) Happy Number

Check if an integer follows the rule of a happy number.

Leetcode 202.

(5) Two Sum

Find two values sum up to target.

Leetcode 1.

(6) Isomorphic Strings

Leetcode 205.

(7) Find Restaurant

Trick: mapping keywords to index.

Leetcode 599.