This repository contains my solutions and notes for:
- Data Structures and Algorithms (DSA)
- Project Euler problems
The purpose of this repository is practice and learning.
Solutions may include brute-force attempts, optimized versions,
and notes explaining the thought process.
- 1_arrays:
- 2_Strings + HashMaps:
- 3_Two Pointers & Sliding Window:
- 3.1 isPalindrome.js: Checks if a string is a palindrome, ignoring non-alphanumeric characters and case.
- 3.2 longestKDistinctChar.js: Finds the length of the longest substring with at most K distinct characters.
- 3.3 longestSubstring.js: Finds the length of the longest substring without repeating characters.
- 3.4 maxArea.js: Finds the container with the most water.
- 3.5 maxSumSubarray.js: Finds the maximum sum of a contiguous subarray of size k.
- 3.6 mergeTwoSortedArray.js: Merges two sorted arrays into one sorted array.
- 3.7 removeDuplicates.js: Removes duplicates from a sorted array in-place.
- 3.8 trap.js: Calculates the amount of water that can be trapped between bars of different heights.
- 3.9 twoSumSorted.js: Finds two numbers in a sorted array that add up to a specific target sum.
- 4_Recursion, Stack & Queue:
- 4.1 factorial.js: Calculates the factorial of a number using recursion.
- 4.2 fibonacci.js: Calculates the nth Fibonacci number using recursion.
- 4.3 firstNonRepeating.js: Finds the first non-repeating character in a stream of characters.
- 4.4 generateSubSets.js: Generates all subsets of a given set using recursion.
- 4.5 isPalindrome.js: Checks if a string is a palindrome using recursion.
- 4.6 minStack.js: Implements a stack that supports retrieving the minimum element in O(1) time.
- 4.7 nextGreaterElement.js: Finds the next greater element for each element in an array.
- 4.8 queue.js: Implements a queue data structure using an array.
- 4.9 reverseString.js: Reverses a string using recursion.
- 4.10 validParentheses.js: Checks if a string of parentheses is valid.
- 5_Linked List & Binary Search:
- 6_Trees & Graphs:
- 7_Greedy, Bit Manipulation & Full Revision:
- 7.1 activitySelection.js: Solves the activity selection problem using a greedy approach.
- 7.2 canCompleteCircuit.js: Determines if a car can complete a circular circuit.
- 7.3 countBits.js: Counts the number of set bits in an integer.
- 7.4 final.js: A revision list of high-probability interview questions.
- 7.5 isPowerOfTwo.js: Checks if a number is a power of two using bit manipulation.
- 7.6 minPlatforms.js: Finds the minimum number of platforms required for a railway station.
- 7.7 singleNumber.js: Finds the single number that appears only once in an array.
- 7.8 swap.js: Swaps two variables using XOR.
- Phase 1 (1-40):
- Phase 2 (41-70):
- project_euler_41_to_70_detailed.txt
- 41-50:
- 51-60:
- 61-70:
- Phase 3 (71-100):
- project_euler_71_to_100_detailed.txt
- 71-80:
- 81-90:
- 91-100: