public static void Main()
Console.WriteLine("Hello World");
public static void AddLists(Node h1, Node h2)
while (h1 != null || h2 != null)
var sumNode = new Node();
sumNode.Data = sumData % 10;
if (sumData > sumNode.Data)
public static (int, Node) AddListsReverse(Node h1, Node h2)
PadList(h2, len1 - len2);
PadList(h2, len2 - len1);
var result = AddListsReverse(h1.Next, h2.Next);
var sum = result.Item1 + h1.Data + h2.Data;
node.Next = result.Item2;
return (sum >= 10 ? 1 : 0, node);
public static Node PadList(Node head, int numOfNodes)
for (int i = 0; i < numOfNodes; i++)
public Node Next {get; set;}
public int Data {get; set;}
public int Length {get; set;}