Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork439
Added: LeetCode solution for Two Sum#523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Added: LeetCode solution for Two Sum#523
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP! |
uday1646 commentedNov 3, 2025
Good sasi kanth |
sasi-upparapalli commentedNov 3, 2025
Hello! 👋 This is my first Hacktoberfest contribution, adding a solution for the Two Sum problem with a clear explanation and README update. I would greatly appreciate it if you could take a moment to review this pull request. Please let me know if any improvements or changes are needed. Thank you very much for your time and for maintaining such a valuable repository! Best regards, |
Two Sum
Problem:
Given an array of integers
numsand an integertarget, return indices of the two numbers such that they add up to target.Approach:
Use a hash map (dictionary) to store visited numbers and their indices. For each element, check if the complement (target - current number) exists in the map. If yes, return the indices.
Time Complexity: O(n)
Space Complexity: O(n)
Difficulty Level: Easy
Tags: Array, Hash Map
Contributor:sasi-upparapalli