Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
Can you solve it without using extra space?
null.gas[i].cost[i] of gas to travel from label and a list of its neighbors.# as a separator for each node, and , as a separator for node label and each{0,1,2#1,2#2,2}.#.0. Connect node 0 to both nodes 1 and 2.1. Connect node 1 to node 2.2. Connect node 2 to node 2 (itself), thus forming a self-cycle.