using System;
public class Program
{
public static void Main()
Console.WriteLine("Hello World");
}
public static bool hasCycle(Node head) {
if(head == null)
return false;
int[] pos = new int[100];
Node curr = head;
while(curr.next != null)
if(pos[curr.data - 1] == 0)
pos[curr.data - 1] = 1;
else
return true;
curr = curr.next;
public class Node
public int data;
public Node next;