Skip to content

Conversation

@sasi-upparapalli
Copy link

Two Sum

Problem:
Given an array of integers nums and an integer target, 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

@welcome
Copy link

welcome bot commented Oct 31, 2025

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

@uday1646
Copy link

uday1646 commented Nov 3, 2025

Good sasi kanth

@sasi-upparapalli
Copy link
Author

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,
sasi-upparapalli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants