---
title: "Discussion on \"leetcode: 2 sum - think about DICTIONARIES\" | Hashnode"
description: "Discussion on \"leetcode: 2 sum - think about DICTIONARIES\". Things I learnt:\nWhen there is mapping to be done, think about a DICTIONARY\n\nHere, we have to use the VALUES of the array, e.g. [1, 2, 3, 4]\n\nFigure out which numbers add up to 6 = 2 + 4\n\n\nBut we want to output the INDEX of the array\n\nSo we need to m..."
url: "https://hashnode.com/posts/leetcode-2-sum-think-about-dictionaries/690e9d5f4b57a03344373b8c"
---

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

Discussion

# [leetcode: 2 sum - think about DICTIONARIES](https://coderlyn.hashnode.dev/leetcode-2-sum-think-about-dictionaries?utm_source=hashnode&utm_medium=feed)

Things I learnt: When there is mapping to be done, think about a DICTIONARY Here, we have to use the VALUES of the array, e.g. \[1, 2, 3, 4\] Figure out which numbers add up to 6 = 2 + 4 But we want to output the INDEX of the array So we need to m...

Nov 8, 2025 · 2 min read · coderlyn.hashnode.dev  
Updated Nov 9, 2025  
Read the article

-   [#leetcode](https://hashnode.com/tag/leetcode)

## Written by

[Lyn Tee](https://hashnode.com/@coderlyn)

@coderlyn

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

iOS & dotnet developer - posting my learnings to help out future me!

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
