package com.leetcode.algorithms.problem1;

import java.util.HashMap;

public class Solution {
    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer,Integer> set = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            int num = nums[i];

                     if(set.containsKey(target-num)){
                         return new int[]{set.get(target-num),i};
                     }
            set.put(num,i);
        }
        return null;
    }
}

@@ -161,16 +161,17 @@
 Integer,
+ 
 Integer%3E
@@ -171,18 +171,32 @@
 nteger%3E 
-se
+hashTableForInpu
 t = new 
@@ -287,26 +287,16 @@
 ums%5Bi%5D;%0A
-%0A         
         
@@ -305,11 +305,26 @@
   if
-(se
+ (hashTableForInpu
 t.co
@@ -343,14 +343,17 @@
 rget
--
+ - 
 num))
+ 
 %7B%0A  
@@ -366,25 +366,16 @@
         
-  
-       
 return n
@@ -383,18 +383,32 @@
 w int%5B%5D%7B
-se
+hashTableForInpu
 t.get(ta
@@ -415,14 +415,17 @@
 rget
--
+ - 
 num),
+ 
 i%7D;%0A
@@ -436,25 +436,16 @@
         
-     
-    
 %7D%0A      
@@ -454,10 +454,24 @@
     
-se
+hashTableForInpu
 t.pu
@@ -476,16 +476,17 @@
 put(num,
+ 
 i);%0A    

format code