Node[] nodes = new Node[10];HashSet<Node> visited = new HashSet<Node>();int count = 0;for (int i = 0; i < nodes.Length; i++){ Node current = nodes[i]; if (visited.Contains(current)) continue; while (current != null) { visited.Add(current); current = current.Next; if (visited.Contains(current) || current == null) { count++; break; } }}
for (int i = 0; i < 10; i++){}
inputValues.Count
List<int> inputValues = new List<int>();for (int i = 0; i < inputValues.Count; i++){ // add user's input to list}