Two Sum

Two sum is my favorite warm up question for a coding interview. Its easy to explain and easy to solve and there aren’t too many clarifying questions that need to be asked. Its one that you can just jump into. The challenge Given an array of integers and an integer target, return indices of the two numbers that sum to the target. Each input shall have but one solution. Examples Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: Because nums[0] + nums[1] == 9, we return [0, 1]....

April 3, 2022