---
title: "Discussion on \"Two Sum — LeetCode #1 (Easy)\" | Hashnode"
description: "Discussion on \"Two Sum — LeetCode #1 (Easy)\". TL;DR\nSingle-pass hash map lookup: store each number's index as you go, check for the complement before storing. O(n) time, O(n) space.\nThe Problem\nGiven an array of integers nums and an integer targe"
url: "https://hashnode.com/posts/two-sum-leetcode-1-easy/6a09c5473104e2aff09dd69e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Two Sum — LeetCode #1 (Easy)](https://blog.logixy.dev/two-sum-leetcode-1-easy?utm_source=hashnode&utm_medium=feed)

TL;DR Single-pass hash map lookup: store each number's index as you go, check for the complement before storing. O(n) time, O(n) space. The Problem Given an array of integers nums and an integer targe

May 17 · 3 min read · blog.logixy.dev  
Read the article

## Written by

[Shubham Gupta](https://hashnode.com/@shbmx)

@shbmx · Goa, India

  
[View profile](https://hashnode.com/@shbmx)

Senior Software Engineer · Flutter, Go, K8s

Senior engineer (Flutter, Go, K8s). I build ESP32 gadgets and run a homelab, then write up the why behind them at iamshubham.dev.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
