DKodeTree
Where logic takes root...!
Practice DSA
Roadmap
About
Two Sum II - Input Array is Sorted - Solution
Solutions and explanations
Link to Problem Statement
View on GitHub
Watch Video
Video Explanation
1. Two Pointers
Optimal
Complexity Analysis
Here,
n
is the input size.
Time Complexity:
O(n)
Space Complexity:
O(1)