diff --git a/Problem1.java b/Problem1.java index e69de29b..68c7d009 100644 --- a/Problem1.java +++ b/Problem1.java @@ -0,0 +1,19 @@ +//Time Complexity: O(n) +//Space Complexity: O(n) +// Did this code successfully run on Leetcode :yes +// Any problem you faced while coding this :no + +import java.util.HashMap; +class Solution { + public int[] twoSum(int[] nums, int target) { + HashMap map = new HashMap<>(); + for(int i=0;i