using System;
using System.Linq;
using System.Collections.Generic;
public class Program
{
public static void Main()
// 5 -> 1 -> 7 -> 2 -> 6
var list =
new ListNode(5,
new ListNode(1,
new ListNode(7,
new ListNode(2,
new ListNode(6)))));
// TODO: Find the middle element of the linked list
}
public class ListNode
public ListNode(int val, ListNode next = null)
this.Value = val;
this.Next = next;
public int Value { get; set; }
public ListNode Next { get; set; }