Added bitwise solutions.