Problem Statement
Given the head of a Singly LinkedList, write a function to determine if the LinkedList has a cycle in it or not.
![Image](/_next/image?url=https%3A%2F%2Fstorage.googleapis.com%2Fdownload%2Fstorage%2Fv1%2Fb%2Fdesigngurus-prod.appspot.com%2Fo%2FdocImages%252F639105492e1c0a1cfe6c1eb9%252Fimg%3A7bf7e77-dc2f-526c-af7f-0dcafb0cfa.png%3Fgeneration%3D1679443690103296%26alt%3Dmedia&w=3840&q=75)
Constraints:
- The number of the nodes in the list is in the range [0, 10<sup>4</sup>].
- 10<sup>5</sup> <= Node.val <= 10<sup>5</sup>
Try it yourself
Try solving this question here:
Python3
Python3