ProDeveloperTutorialonJanuary 19, 2025 Get the least number of perfect squares Problem Statement: You are given a number “n”. You need to return the least number of perfect square number that sum to n. A…
ProDeveloperTutorialonJanuary 19, 2025 Get the nth Fibonacci Number Problem Statement: You are given a number, you need to find the sum of the 2 preceding Fibonacci sequence. F(n) = F(n-1) + F (n-2) Example…
ProDeveloperTutorialonJanuary 19, 2025 Count the ways to decode a digit sequence Problem Statement: You are given an digit sequence, you need to count the number of possible decoding of the given digit sequence. Example…
ProDeveloperTutorialonJanuary 19, 2025 Climb the stairs with minimum cost Problem Statement: You are given an array with the cost. Where the cost[i] represents the cost of ith step of the stairs. If you step on the…
ProDeveloperTutorialonJanuary 19, 2025 Dice Sum Problem Problem Statement: You are given a number “n”. You need to count the number of ways to construct the sum by throwing a dice one or…
ProDeveloperTutorialonJanuary 19, 2025 Check if a graph is a strongly connected using Kosaraju DFS algorithm Problem Statement: You are given a directed graph, you need to find out if the graph is strongly connected or not. A strongly connected garph…
ProDeveloperTutorialonJanuary 19, 2025 Find if there is a path between 2 nodes in an undirected graph Problem Statement: You are given an undirected graph along with 2 nodes. You need to check if there is a path between the 2 nodes. Solution We…
ProDeveloperTutorialonJanuary 19, 2025 Get the unique lengths of connected components of an undirected graph. Problem Statement: You are given an undirected graph with connected components. Then you need to provide output of the unique length of…
ProDeveloperTutorialonJanuary 19, 2025 Get the maximum sum of values of nodes among all connected components of an undirected graph Problem Statement: You are given an undirected graph with connected components. Every node has a value assigned to it. You need to get the…
ProDeveloperTutorialonJanuary 19, 2025 Find there is a path between 2 nodes in a directed graph Problem Statement: You are given a directed graph and 2 nodes. You need to find if there is a path between those two nodes. Solution We use…