saved bitwise and hash table solutions separately