Python Interview Question & Answer Part 4 | Two Sum problem in Python
Problem Statement :- Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Input: nums = [3,2,4], target = 6
Output: [1,2]
Input: nums = [3,3], target = 6
Output: [0,1]
-------------------------------------------------------------------------
๐๐ผ๐ถ๐ป ๐บ๐ฒ ๐ผ๐ป ๐ฆ๐ผ๐ฐ๐ถ๐ฎ๐น ๐ ๐ฒ๐ฑ๐ถ๐ฎ:๐ฅ
-------------------------------------------------------------------------
*Instagram :
https://www.instagram.com/itjunction4all/
*Twitter:
https://twitter.com/sunilkr5672
#pythoninterview #pythoninterviewquestions #pythonprogramming #pythonforbeginners #python