π§ Algorithm Problems Solutions
A collection of solved algorithm problems from LeetCode , NeetCode , FreeCodeCamp , and HackerRank .
Platform
Problems Solved
LeetCode
71
NeetCode
6
FreeCodeCamp
13
HackerRank
4
| Problem | Solution | Category |
|---------|----------|----------|| Binary Search | JavaScript | Binary Search || Contains Duplicate | JavaScript | Arrays & Hashing |
| Is Palindrome | JavaScript | Two Pointers |
| Reverse Linked List | JavaScript | Linked Lists |
| Top K Frequent Elements | JavaScript | Arrays & Hashing |
| Valid Anagram | JavaScript | Arrays & Hashing |
π₯ FreeCodeCamp Problems
Problem
Solution
Description
Array Swap
JavaScript
Reverse an array
FizzBuzz Mini
JavaScript
Return Fizz, Buzz, FizzBuzz, or the number
Flatten the Array
JavaScript
Flatten a nested array
Good day
JavaScript
Return greeting based on time of day
Is Flat
JavaScript
Check if an array has no nested arrays
Is Odd or Even
JavaScript
Check if a number is odd or even
Is Valid Hex
JavaScript
Validate hex color codes
Letter and Number Count
JavaScript
Count letters and numbers in a string
Odd or Even Day
JavaScript
Check if a day of month is odd or even
Parsec Converter
JavaScript
Convert parsec values based on odd/even
Rock Paper Scissors
JavaScript
Classic RPS game implementation
Sorted Array
JavaScript
Array sorting algorithm
Truncate Text
JavaScript
Truncate text to 20 chars with ellipsis
Algorithm
Solution
Time Complexity
Space Complexity
Bubble Sort
Python
O(nΒ²)
O(1)
Merge Sort
Python
O(n log n)
O(n)
Quick Sort
Python
O(n log n)
O(log n)
Algorithm
Solution
Time Complexity
Space Complexity
Dijkstra
Python
O((V + E) log V)
O(V)
Structure
Solution
Description
Binary Tree
Python
Basic binary tree implementation
Hashmap
Python
Hash map implementation with put, get, and remove operations
Min Heap
Python
Min heap implementation
Stack
Python
Linked-list stack with push, pop, peek, and size operations
Trie
Python , Nim
Prefix tree with insert, search, and starts_with operations
JavaScript - Primary language for most solutions
TypeScript - Type-safe JavaScript solutions
Python - Clean and readable solutions
Scala - Functional programming approach
Java - Object-oriented solutions
Nim - Fast and expressive systems programming language
π File Naming Convention
LeetCode: {problem-number}-{problem-name}.{extension}
NeetCode: neetcode-{problem-name}.{extension}
FreeCodeCamp: freecodecamp-{problem-name}.{extension}
HackerRank: hackerhank-{problem-name}.{extension}
node filename.js
# or with ts-node for TypeScript
npx ts-node filename.ts
javac filename.java && java ClassName
This repository is for educational purposes. Feel free to use the solutions as reference for learning.
β Happy Coding!