package main;

import problem.mergesort.*;
import datastructure.listnode.*;

public class Main {
  public static void main(String[] args) {
	// PROBLEM Merge-sort Linked List
    MergeSortLinkedList();
    
    // PROBLEM Two Sum
    TwoSum();
  }
  
  public static void MergeSortLinkedList() {
	System.out.println("==============================\n");
	System.out.println("PROBLEM Merge-sort Linked List\n");
	System.out.println("==============================\n");
	
	// Generate a sample input [4, 2, 5, 3, 6]
	System.out.println("Generate a sample input [4, 2, 5, 3, 6]\n");
    ListNode nodeFirst = new ListNode(4);
    ListNode nodeSecond = new ListNode(2);
    ListNode nodeThird = new ListNode(5);
    ListNode nodeFourth = new ListNode(3);
    ListNode nodeFifth = new ListNode(6);
    
    nodeFirst.next = nodeSecond;
    nodeSecond.next = nodeThird;
    nodeThird.next = nodeFourth;
    nodeFourth.next = nodeFifth;
    nodeFifth.next = null;
        
    // Merge sort the sample input
    nodeFirst = MergeSortLinkedList.mergeSortList(nodeFirst);
    
    // Print out result
    MergeSortLinkedList.printList(nodeFirst);
	
	System.out.println("\n\n");
  }
  
  public static void TwoSum() {
	System.out.println("===============\n");
	System.out.println("PROBLEM Two Sum\n");
	System.out.println("===============\n");
	
	// Generate a sample input
	// numbers={2, 7, 11, 15}, target=9
	System.out.println("Generate a sample input\n");
    System.out.println("numbers={2, 7, 11, 15}, target=9\n");
        
    // Merge sort the sample input
    
    // Print output
    
	System.out.println("\n\n");
  }
}

@@ -36,16 +36,41 @@
 sort.*;%0A
+import problem.twosum.*;%0A
 import d
@@ -357,34 +357,32 @@
 ================
-%5Cn
 %22);%0A%09System.out.
@@ -420,18 +420,16 @@
 ked List
-%5Cn
 %22);%0A%09Sys
@@ -467,34 +467,32 @@
 ================
-%5Cn
 %22);%0A%09%0A%09// Genera
@@ -585,18 +585,16 @@
 5, 3, 6%5D
-%5Cn
 %22);%0A    
@@ -1161,36 +1161,32 @@
 em.out.println(%22
-%5Cn%5Cn
 %22);%0A  %7D%0A  %0A  pub
@@ -1244,26 +1244,24 @@
 ============
-%5Cn
 %22);%0A%09System.
@@ -1288,18 +1288,16 @@
  Two Sum
-%5Cn
 %22);%0A%09Sys
@@ -1328,18 +1328,16 @@
 ========
-%5Cn
 %22);%0A%09%0A%09/
@@ -1374,33 +1374,37 @@
 numbers=%7B2, 
-7, 11
+3, 3, 2, 4
 , 1
-5
 %7D, target=9%0A
@@ -1401,17 +1401,17 @@
  target=
-9
+5
 %0A%09System
@@ -1447,18 +1447,16 @@
 le input
-%5Cn
 %22);%0A    
@@ -1491,17 +1491,21 @@
 %7B2, 
-7, 11
+3, 3, 2, 4
 , 1
-5
 %7D, t
@@ -1514,19 +1514,17 @@
 get=
-9%5Cn
+5
 %22);%0A    
     
@@ -1523,47 +1523,367 @@
     
-    %0A    // Merge sort the sample input
+int%5B%5D intArrayTwoSum = new int%5B7%5D;%0A    intArrayTwoSum%5B0%5D = 2;%0A    intArrayTwoSum%5B1%5D = 3;%0A    intArrayTwoSum%5B2%5D = 3;%0A    intArrayTwoSum%5B3%5D = 2;%0A    intArrayTwoSum%5B5%5D = 4;%0A    intArrayTwoSum%5B6%5D = 1;%0A    %0A    int targetTwoSum = 5;%0A    %0A    // Calculate two sum %0A    int%5B%5D resultTwoSum = new int%5B2%5D;%0A    resultTwoSum = TwoSum.twoSum(intArrayTwoSum, targetTwoSum);
 %0A   
@@ -1907,15 +1907,17 @@
 tput
-%0A
     %0A
-%09
+    
 Syst
@@ -1936,12 +1936,127 @@
 ln(%22
-%5Cn%5Cn
+The result is index1=%22 + resultTwoSum%5B0%5D + %22, index2=%22%0A                       + resultTwoSum%5B1%5D);%0A%09System.out.println(%22
 %22);%0A

Update Main.java