Skip to content

Added solution for Two Sum#21

Open
Betcy-Rajan wants to merge 5 commits intoWeCode-Community-Dev:mainfrom
Betcy-Rajan:betcy
Open

Added solution for Two Sum#21
Betcy-Rajan wants to merge 5 commits intoWeCode-Community-Dev:mainfrom
Betcy-Rajan:betcy

Conversation

@Betcy-Rajan
Copy link

Added solutions for twoSum problem in the Blind 75 Challenge
Use a dictionary (Sums) to store numbers and their corresponding indices.
Iterate through the array and check if the complement (target - current number) exists in Sums.
If it exists, return the indices of the two numbers.
Otherwise, store the number with its index in Sums.

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.

1 participant