linked list cycle
linked list cycle 2

using hashmap to track visited node