Question: Write a function in R to do the following: Given a list of integers and an integer target, return the indices of the two numbers
Write a function in R to do the following: Given a list of integers and an integer target, return the indices of the two numbers such which add up to target. Example: Input: inputlist = [2, 1, 7, 23], target = 8 output: [1,2] Explanation: inputlist[1] = 1, inputlist[2] = 7, 1 7 = 8, thus, return [1,2]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
