I felt like doing an algorithm and found this problem on leetcode
Given an array of integers, find two numbers such that they add up to a specific target num
Swift code with Time Complexity O(n) and Space complexity O(n):
import UIKit class Solution{ func twoSum(_ nums: [Int], _ target: Int) -> [Int]{ var finalArray = [Int]() var newDictionary = [Int:Int]() for i in 0..