Blank Video Poster

leet code : Two sum Problem solution

Oct 24, 2022
nileshblog.tech Logo

nileshblog.tech

Input: nums = [7,2,13,11], target = 9Output: [0,1] Example 2: Input: nums = [7,3,5], target = 8Output: [1,2] Solution: First, let us attempt to comprehend the issue statement. We are provided an array of integer items as well as a goal total. Our task is to build an algorithm that returns the indices of two entries in this array so that when we combine these two elements, the total should equal the goal amount.