This repository provides code snippets for several of the programming questions. The questions have been read from various sources. Wherever possible, there would be links presented along with question.
I use mostly Javascript, Typescript, Java, and Scala. You can expect solutions in one of these programming languages.
The problems for the documented solutions have been fetched from various sources including Udemy, AlgoExpert, LeetCode, Educative, etc. Wherever possible, I am attaching the source. I am not attaching the sources for premium subscriptions, just to make sure the premium subscriptions are not misused.
Happy to accept any contributions to this in any langugage.
- Find Numbers with Even Numbers of Digits | Solution
- Roman To Integer | Solution
- Excel Sheet Column Title | Solution
- Second Highest Salary | Solution
- Valid Phone Numbers | Solution
- Count Primes | Solution 1 | Solution 2
- Sorted Array Merge | Solution
- Educative Array | Solution
- Find Pair Sum | Solution
- Third Maximum Number | Solution 1 | Solution 2 | Solution 3
- Median of 2 sorted arrays | Solution
- K-Diff Pairs in an array | Solution
- Shortest Sorted Continuous Subarray | Solution 1 | Solution 2 | Solution 3 | Solution 4 | Solution 5 | Solution 6 | Solution 7
- Non Decreasing Array | Solution 1 | Solution 2 | Solution 3
- Buddy Strings | Solution 1 | Solution 2
- Rearrange Positive Negative | Solution
- Rearrange Sorted Max Min | Solution
- String Duplicates | Solution
- String Reversal | Solution
- Valid Paranthesis | Solution 1
- Minimum Remove to Make Valid Paranthesis | Solution
- Finding if the string with curly braces are balanced | Solution
- Create a minimum height BST using a sorted input array | Solution
- Find Longest Peak in an array | Solution
- Monotonic Increasing | Solution 1 | Solution 2
- Suffix Trie Construction | Solution
- Traversing a 2D Array in a Spiral Order: Returning 1D Array | Solution
- Finding groups of anagrams in a string | Solution 1 | Solution 2
- Finding Longest Palindromic Substring | Solution 1 BF | Solution 2
- Min Max Stack | Solution
- Leet Code 146 - LRU Cache | Solution Java Collection | Solution Typescript Custom
- Leet Code 283 Move Zeros | Solution | Solution 2
- Leet Code 70 Climbing Stairs | Solution DP Top Down | Solution DP Bottoms Up
- Leet Code 200 Number of Islands | Solution 1 DFS | Solution BFS | Solution Union Find
- Leet Code 362 Design Hit Counter | Solution 1 | Solution 2
- LeetCode Web Crawler 1242 | Solution 1 | Solution 2
- Leet Code 554 Brick Wall | Solution 1
- Leet Code 1190 Reverse Substrings Between Each Pair of Paranthesis | Solution 1 | Solution Optimized
- Leet Code 22 Generate Paranthesis | Solution Brute Force | Solution BF Optimized
- Find Missing Positive | Solution
- Read N Characters Given Read 4 II - Call Multiple Times - LeetCode 158 | Solution 1 | Solution 2 Optimized
- Bubble Sort | Solution
- Insertion Sort | Solution
- Merge Sort | Solution
- Quick Sort | Solution
- Radix Sort | Solution
- Selection Sort | Solution
- Anagram Check | Solution
- Are Same with Squares? | Solution
- Check Substring | Solution
- Count Characters in String | Solution
- Same Frequency | Solution
- Are there Duplicates? | Solution
- Average Pair | Solution
- Count Unique Values | Solution
- Zero Sum Pair | Solution
- Capitalize Words | Solution
- Collect Strings | Solution
- Fibonnaci | Solution Bottoms Up | Solution Dynamic Programming | Solution Recursion | Solution Recursive
- Factorial | Solution
- Flatten | Solution
- Is Palindrome? | Solution
- Nested Even Sum | Solution
- Power | Solution
- Product of Arrays | Solution
- Range | Solution
- Some Recursive | Solution
- Stringify Numbers | Solution
- Detecting Loops in Linked List | Solution
- Find Middle Node in Linked List | Solution
- Find nth node from last | Solution
- Reverse Linked List | Solution
- Linear Search | Solution
- Binary Search | Solution
- Searching in a Sorted Array | Solution 1 | Solution 2
- 0/1 Knapsack Problem
- Equal Subset Problem
- Subset Sum Problem
- Minimum Difference Subset Sum
- Count of Subset Sum
- Target Sum using positive negative assignments
- Unbounded Knapsack Problem
- Road Cutting
- Coin Change
- Minimum Coin Change Needed
- Maximum Ribbon Cut
- Solution Dynamic Programming Top Down
- [Solution Dynamic Programming Bottoms Up](./dynamic_programming/
- MaximumRibbonCut_2.ts)
- Find Longest Palindromic Subsequence