Package Level2; import java. util. hashMap; import java. util. hashtable;/*** Two Sum ** Given an array of integers, find two numbers such that they add up to a specific target number. the function twoSum shocould return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-bas Ed. you may assume that each input wowould have exactly one solution. input: numbers = {2, 7, 11, 15}, target = 9 Output: index1 = 1, index2 = 2 */public class S1 {public static void main (String [] args) {Hashtable <Integer, Integer> ht = new Hashtable <Integer, Integer> (); System. out. println (ht. get (22);} public int [] twoSum (int [] numbers, int target) {// place the value and array subscript Hashtable <Integer, Integer> ht = new Hash Table <Integer, Integer> (); int [] ret = new int [2]; for (int I = 0; I <numbers. length; I ++) {// find if (ht. get (target-numbers [I])! = Null) {ret [0] = ht. get (target-numbers [I]) + 1; ret [1] = I + 1;} else {ht. put (numbers [I], I) ;}} return ret ;}}