344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". class Solution { public: string reverseString(string s) { string::size_type i, j; if (s.size…
Two Sum 1 public int[] twoSum(int[] numbers,int target){ Map<Integer,Integer> map = new HashMap<Integer,Integer>(); for(int i=0;i<numbers.length;i++){ int num = numbers[i]; if(map.containsKey(target-num)){ return new int[]{map.get(num)+1,i+…