Problem Solution Could use nested for-loops but that will end up with O(n^2) complexity. Arrays have constant complexity when accessing a known index. However arrays can have up to O(n) complexity when searching while hashmap has near constant complexity. In order to improve the speed, make a hashmap by mapping each element in nums to its index number. When iterating through the array, get the c..