Depth-first-search

Level: Advanced

1. Implement a function to solve the "Traveling Salesman Problem" using DFS.
2. Write a function to solve the "Word Search" problem in a 2D grid using DFS.
3. Implement a function to find the longest palindromic subsequence in a string using DFS.
4. Write a function to solve the "Subset Partition Problem" using DFS.
5. Implement a function to find the longest path in a weighted graph using DFS.
6. Write a function to solve the "Maximal Rectangle" problem in a binary matrix using DFS.
7. Implement a function to solve the "Remove Invalid Parentheses" problem using DFS.
8. Write a function to find all cycles in a directed graph using DFS.
9. Implement a function to solve the "Optimal Account Balancing" problem using DFS.
10. Write a function to find the maximum length of a concatenated string with unique characters using DFS.
11. Implement a function to solve the "Palindrome Partitioning" problem using DFS.
12. Write a function to find the minimum cost to connect all points in a graph using DFS.
13. Implement a function to solve the "Expression Add Operators" problem using DFS.
14. Write a function to find the number of ways to paint a fence using DFS.
15. Implement a function to find all valid parentheses combinations using DFS.
16. Write a function to solve the "Count of Smaller Numbers After Self" problem using DFS.
17. Implement a function to find the longest path with different adjacent characters in a tree using DFS.
18. Write a function to solve the "All Paths From Source to Target" problem in a graph using DFS.
19. Implement a function to find the maximum sum of non-adjacent nodes in a binary tree using DFS.
20. Write a function to solve the "Reconstruct Itinerary" problem using DFS.
21. Implement a function to solve the "Longest Increasing Path in a Matrix" problem using DFS.
22. Write a function to solve the "Concatenated Words" problem using DFS.
23. Implement a function to find the minimum height trees in a graph using DFS.
24. Write a function to solve the "Cheapest Flights Within K Stops" problem using DFS.
25. Implement a function to solve the "K-Similar Strings" problem using DFS.
26. Write a function to find the number of restricted paths from the first to the last node using DFS.
27. Implement a function to find the maximum length of a substring with at most k distinct characters using DFS.
28. Write a function to solve the "Unique Paths III" problem using DFS.
29. Implement a function to find the maximum number of consecutive ones in a binary matrix using DFS.
30. Write a function to solve the "Count Different Palindromic Subsequences" problem using DFS.

Beginner Level: View

Advanced Level: View