using System.Collections.Generic;
public static void Main()
Node<int> myList = Build(new Node<int>(0));
int count = Count(myList, 2);
Console.WriteLine(count);
public static int Count(Node<int> head, int n)
Node<int> current = head;
if(current.val == n) ans++;
public Node(T v) {val = v;}
public static Node<int> Build(Node<int> head)
Node<int> current = head;
for(int i = 2; i < 4; i++)
Node<int> n = new Node<int>(i);
public static List<int> Build()
List<int> myList = new List<int>();
for(int i = 1; i < 4; i++)