Welcome to my Data Structures and Algorithms (DSA) practice repository!
This repository contains solutions to problems from NeetCode 150 and LeetCode to improve my problem-solving skills.
- Arrays & Hashing
- Two Pointers
- Sliding Window
- Stack
- Binary Search
- Linked List
- Trees
- Tries
- Backtracking
- Heap / Priority Queue
- Graphs
- 1D Dynamic Programming
- Intervals
- Greedy
- Advanced Graphs
- 2D Dynamic Programming
- Bit Manipulation
- Math & Geometry
- Difficulty:
- Problem Link: NeetCode
- Approach:
- Use a hash map (array) to count character frequencies in
s. - Decrease count for each character in
t. - If all counts reduce to zero β strings are anagrams.
- Use a hash map (array) to count character frequencies in
- Time Complexity: O(n + m)
- Space Complexity: O(1)
- Solution: anagram.js
- Difficulty:
- Problem Link: NeetCode
- Approach:
- Use a
Setto track seen numbers. - Return true if a duplicate is found, otherwise false.
- Use a
- Time Complexity: O(n)
- Space Complexity: O(n)
- Solution: duplication.js
- Difficulty:
- Problem Link: NeetCode
- Approach:
- Count character frequencies for each word and use as a key in a
Map. - Group words with the same key together.
- Count character frequencies for each word and use as a key in a
- Solution: groupanagram.js
- Difficulty:
- Problem Link: LeetCode
- Approach:
- Use a
Mapto store seen numbers and their indices. - For each number, check if
target - currentexists. - Return indices if found.
- Use a
- Time Complexity: O(n)
- Space Complexity: O(n)
- Solution: twosum.js
- Clone the repository:
git clone https://github.com/Nitesh0434/DSA-Practice.git
# Fri Sep 12 11:11:44 PM +0545 2025