This repository showcases solutions to a variety of coding questions across multiple programming languages. Whether you're a beginner looking to learn new languages or an experienced developer seeking different approaches to problem-solving, this collection is for you!
Diverse Languages: Solutions are provided in several popular programming languages, including Python, Java, C++, JavaScript, and more. Variety of Questions: From algorithmic challenges to data structures and basic programming tasks, explore a wide range of questions. Clear Documentation: Each solution includes explanations and comments to help you understand the logic behind the code.
- Check if a number is even or odd.
- Find the largest of three numbers.
- Return the factorial of a number.
- Reverse a string.
- Check if a string is a palindrome.
- Sum all elements in an array.
- Calculate the nth Fibonacci number.
- Return the sum of digits of a number.
- Determine if a number is prime.
- Sort an array of numbers in ascending order.
- Convert Celsius to Fahrenheit and vice versa.
- Generate a multiplication table for a given number.
- Count the number of vowels in a string.
- Find the maximum and minimum numbers in an array.
- Merge two sorted arrays into one sorted array.
- Remove duplicates from an array.
- Check if two strings are anagrams.
- Count the number of occurrences of a character in a string.
- Find the longest word in a string.
- Capitalize the first letter of every word in a string.
- Rotate an array by k positions.
- Check if a number is a power of two.
- Find the GCD (Greatest Common Divisor) of two numbers.
- Convert a binary number to decimal.
- Check if a given year is a leap year.
- Flatten a nested array.
- Find the intersection of two arrays.
- Check if a string has balanced parentheses.
- Calculate the square root of a number without built-in methods.
- Find the most frequent element in an array.
- Find the longest common prefix among an array of strings.
- Remove all falsy values from an array.
- Return the number of occurrences of each element in an array.
- Return the nth largest element in an array.
- Generate all possible permutations of a string.
- Implement the Sieve of Eratosthenes for prime numbers.
- Check if a string contains only unique characters.
- Implement binary search on a sorted array.
- Generate Pascal's triangle.
- Convert a Roman numeral to an integer.
- Find the longest substring without repeating characters.
- Merge intervals.
- Implement the Tower of Hanoi problem.
- Calculate the number of trailing zeros in the factorial of a number.
- Check if a number is an Armstrong number.
- Generate all combinations of well-formed parentheses.
- Perform matrix multiplication.
- Find the first non-repeating character in a string.
- Find the smallest missing positive integer in an array.
- Find all prime factors of a number.
- Solve the N-Queens problem.
- Find the median of two sorted arrays.
- Implement a linked list in TypeScript.
- Find the shortest path in a maze (BFS).
- Solve the 0/1 Knapsack problem using dynamic programming.
- Perform depth-first search (DFS) on a graph.
- Implement a priority queue.
- Solve the traveling salesman problem using dynamic programming.
- Serialize and deserialize a binary tree.
- Find the kth smallest element in a binary search tree.
- Solve the coin change problem using dynamic programming.
- Implement merge sort.
- Implement quicksort in TypeScript.
- Detect a cycle in a graph.
- Find the maximum subarray sum using Kadane’s algorithm.
- Find all possible subsets of an array (power set).
- Determine if a given Sudoku board is valid.
- Perform in-order traversal of a binary tree without recursion.
- Implement a trie (prefix tree) for word search.
- Perform matrix rotation by 90 degrees.
- Solve the word break problem using dynamic programming.
- Find the longest palindromic substring.
- Check if two binary trees are the same.
- Solve the minimum edit distance (Levenshtein distance) problem.
- Solve the regular expression matching problem.
- Solve the integer partition problem.
- Solve the sliding window maximum problem.
- Build a heap from an array.
- Solve the maximum flow problem using the Ford-Fulkerson algorithm.
- Implement Dijkstra's algorithm for shortest paths in a graph.
- Find the articulation points in a graph.
- Implement the Bellman-Ford algorithm to detect negative weight cycles.
- Perform topological sort on a directed acyclic graph.
- Find the diameter of a binary tree.
- Solve the regular expression wildcard matching problem.
- Solve the word ladder problem using BFS.
- Solve the maximum bipartite matching problem.
- Solve the edit distance problem with memoization.
- Solve the subset sum problem.
- Find the longest increasing subsequence.
- Solve the job scheduling problem.
- Perform breadth-first search on a binary tree.
- Solve the Boolean parenthesization problem.
- Find bridges in a graph.
- Solve the Hamiltonian path problem.
- Find the longest path in a directed acyclic graph.
- Solve the egg drop problem using dynamic programming.
- Perform randomized quicksort.
- Solve the painter’s partition problem.
- Solve the longest common subsequence problem.