This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Problen 1 | |
| private static int[] twoSum(int[] arr, int target) { | |
| HashMap<Integer, Integer> visited = new HashMap<>(); // num -> idx | |
| for (int i=0; i< arr.length; i++) { | |
| int required = target-arr[i]; | |
| if (visited.containsKey(required)) { | |
| return new int[] {visited.get(required), i}; | |
| } | |
| visited.put(arr[i], i); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "countries": [ | |
| { | |
| "country": "Afghanistan", | |
| "states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"] | |
| }, | |
| { | |
| "country": "Albania", | |
| "states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"] | |
| }, |