File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ # LeetCode
2+
3+ A collection of my solutions to LeetCode problems, written for learning, practice, and fun.
4+ Each solution is written with readability and efficiency in mind.
5+
6+ ---
7+
8+ ## Structure
9+
10+ Each file is named after the problem title or number, e.g. ` 0001-two-sum.js ` .
11+
12+ ---
13+
14+ ## Topics
15+
16+ - Arrays & Strings
17+ - Hash Maps
18+ - Two Pointers
19+ - Sliding Window
20+ - Recursion & Backtracking
21+ - Trees & Graphs
22+ - Dynamic Programming
23+ - Greedy Algorithms
24+
25+ ---
26+
27+ ## Example
28+
29+ ``` js
30+ // 1. Two Sum
31+ var twoSum = function (nums , target ) {
32+ const map = new Map ();
33+ for (let i = 0 ; i < nums .length ; i++ ) {
34+ const diff = target - nums[i];
35+ if (map .has (diff)) {
36+ return [map .get (diff), i];
37+ }
38+ map .set (nums[i], i);
39+ }
40+ };
41+ ```
You can’t perform that action at this time.
0 commit comments