Write a function two_sum_sorted(nums, target) using two pointers on a sorted list
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Write a function two_sum_sorted(nums, target) using two pointers on a sorted list. Given nums = [1, 3, 5, 7, 9, 11] and target = 12, find the indices of the two numbers that sum to target. Print the result.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.