1. Start with 2 pointers P and Q
2. Move P 2 pointers and Q one pointer every time
3. Check if P is same as Q
4. If at any point P = Q then we have a cycle
The logic is if P has double speed of Q and there exists a cycle P will overtake Q and will overlapse once both are in the cycle.
1. Start with 2 pointers P and Q
2. Move P 2 pointers and Q one pointer every time
3. Check if P is same as Q
4. If at any point P = Q then we have a cycle
The logic is if P has double speed of Q and there exists a cycle P will overtake Q and will overlapse once both are in the cycle.
Buy:Petcam (Metacam) Oral Suspension.Prednisolone.Accutane.Actos.Zovirax.Lumigan.Valtrex.Prevacid.Retin-A.Zyban.Arimidex.Human Growth Hormone.Mega Hoodia.100% Pure Okinawan Coral Calcium.Nexium.Synthroid….