Skip to content

yoursandeshshrestha/Logic-Mastery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solving Questions in Multiple Languages

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!

Features

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.

Basic Questions (1-25)

  1. Check if a number is even or odd.
  2. Find the largest of three numbers.
  3. Return the factorial of a number.
  4. Reverse a string.
  5. Check if a string is a palindrome.
  6. Sum all elements in an array.
  7. Calculate the nth Fibonacci number.
  8. Return the sum of digits of a number.
  9. Determine if a number is prime.
  10. Sort an array of numbers in ascending order.
  11. Convert Celsius to Fahrenheit and vice versa.
  12. Generate a multiplication table for a given number.
  13. Count the number of vowels in a string.
  14. Find the maximum and minimum numbers in an array.
  15. Merge two sorted arrays into one sorted array.
  16. Remove duplicates from an array.
  17. Check if two strings are anagrams.
  18. Count the number of occurrences of a character in a string.
  19. Find the longest word in a string.
  20. Capitalize the first letter of every word in a string.
  21. Rotate an array by k positions.
  22. Check if a number is a power of two.
  23. Find the GCD (Greatest Common Divisor) of two numbers.
  24. Convert a binary number to decimal.
  25. Check if a given year is a leap year.

Intermediate Questions (26-50)

  1. Flatten a nested array.
  2. Find the intersection of two arrays.
  3. Check if a string has balanced parentheses.
  4. Calculate the square root of a number without built-in methods.
  5. Find the most frequent element in an array.
  6. Find the longest common prefix among an array of strings.
  7. Remove all falsy values from an array.
  8. Return the number of occurrences of each element in an array.
  9. Return the nth largest element in an array.
  10. Generate all possible permutations of a string.
  11. Implement the Sieve of Eratosthenes for prime numbers.
  12. Check if a string contains only unique characters.
  13. Implement binary search on a sorted array.
  14. Generate Pascal's triangle.
  15. Convert a Roman numeral to an integer.
  16. Find the longest substring without repeating characters.
  17. Merge intervals.
  18. Implement the Tower of Hanoi problem.
  19. Calculate the number of trailing zeros in the factorial of a number.
  20. Check if a number is an Armstrong number.
  21. Generate all combinations of well-formed parentheses.
  22. Perform matrix multiplication.
  23. Find the first non-repeating character in a string.
  24. Find the smallest missing positive integer in an array.
  25. Find all prime factors of a number.

Advanced Questions (51-75)

  1. Solve the N-Queens problem.
  2. Find the median of two sorted arrays.
  3. Implement a linked list in TypeScript.
  4. Find the shortest path in a maze (BFS).
  5. Solve the 0/1 Knapsack problem using dynamic programming.
  6. Perform depth-first search (DFS) on a graph.
  7. Implement a priority queue.
  8. Solve the traveling salesman problem using dynamic programming.
  9. Serialize and deserialize a binary tree.
  10. Find the kth smallest element in a binary search tree.
  11. Solve the coin change problem using dynamic programming.
  12. Implement merge sort.
  13. Implement quicksort in TypeScript.
  14. Detect a cycle in a graph.
  15. Find the maximum subarray sum using Kadane’s algorithm.
  16. Find all possible subsets of an array (power set).
  17. Determine if a given Sudoku board is valid.
  18. Perform in-order traversal of a binary tree without recursion.
  19. Implement a trie (prefix tree) for word search.
  20. Perform matrix rotation by 90 degrees.
  21. Solve the word break problem using dynamic programming.
  22. Find the longest palindromic substring.
  23. Check if two binary trees are the same.
  24. Solve the minimum edit distance (Levenshtein distance) problem.
  25. Solve the regular expression matching problem.

Expert Questions (76-100)

  1. Solve the integer partition problem.
  2. Solve the sliding window maximum problem.
  3. Build a heap from an array.
  4. Solve the maximum flow problem using the Ford-Fulkerson algorithm.
  5. Implement Dijkstra's algorithm for shortest paths in a graph.
  6. Find the articulation points in a graph.
  7. Implement the Bellman-Ford algorithm to detect negative weight cycles.
  8. Perform topological sort on a directed acyclic graph.
  9. Find the diameter of a binary tree.
  10. Solve the regular expression wildcard matching problem.
  11. Solve the word ladder problem using BFS.
  12. Solve the maximum bipartite matching problem.
  13. Solve the edit distance problem with memoization.
  14. Solve the subset sum problem.
  15. Find the longest increasing subsequence.
  16. Solve the job scheduling problem.
  17. Perform breadth-first search on a binary tree.
  18. Solve the Boolean parenthesization problem.
  19. Find bridges in a graph.
  20. Solve the Hamiltonian path problem.
  21. Find the longest path in a directed acyclic graph.
  22. Solve the egg drop problem using dynamic programming.
  23. Perform randomized quicksort.
  24. Solve the painter’s partition problem.
  25. Solve the longest common subsequence problem.