This repository contains my LeetCode solutions written in JavaScript.
All solutions follow a clean and consistent structure with explanations,
time & space complexity, and optimized approaches.
leetcode/ array/ string/ two-pointers/ sliding-window/ hashmap/ stack/ recursion/ binary-search/ dynamic-programming/
Each folder contains solutions from that topic.
Example:
array/27-remove-element.js
string/344-reverse-string.js
| Category | Folder |
|---|---|
| Arrays | array/ |
| Strings | string/ |
| Two Pointers | two-pointers/ |
| Sliding Window | sliding-window/ |
| Hash Map | hashmap/ |
| Stack & Queue | stack/ |
| Recursion | recursion/ |
| Binary Search | binary-search/ |
| Dynamic Programming | dynamic-programming/ |
| Problem | Link |
|---|---|
| 26. Remove Duplicates from Sorted Array | Solution |
| 27. Remove Element | Solution |
| 344. Reverse String | Solution |
| Problem | Link |
|---|
(I will update this table as I solve more problems.)
Every solution file follows this consistent style:
/**
* LeetCode <problem-number> β <problem-title>
*
* Problem:
* <Write a short summary of the problem>
*
* Approach:
* <Explain approach: two pointers, sliding window, etc>
*
* Time Complexity: O(n)
* Space Complexity: O(1)
*/
function solutionName(input) {
// logic
}
// Example:
console.log(solutionName(...));