Two Sum Problem A bit of diversion today. I am going to solve the Two-Sum problem. Question:(You can find it in leetcode). The problem statement is shown below: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[ 0 ] + nums[ 1 ] = 2 + 7 = 9, return [ 0 , 1 ]. My approach: We need some way to store the indexes of the values which sums up to target. Track the sum of 2 numbers and check if the sum is equal to target. Brute-Force Approach: Loop through the array to check if the sum of 2 numbers is equal to target. public static int[] CalculateTwoSum(int[] arr, int d) { for (int i = 0; i < arr.Length; i++) ...