Skip to content

Category Archives: Dynamic Programming

Dynamic Programming (DP) is defined as a technique that solves some particular type of problems in Polynomial Time. Dynamic Programming solutions are faster than the… Read More
Given a string S of length N consisting of digits from ‘0’ to ‘9’ .The task is to determine the total number of possible ways… Read More
For N given cities, find how many ways a driver can traverse through them so that each town is visited exactly K times. From each… Read More
Given 4 numbers N, M, X, Y. which represent N numbers for the first item and M numbers for the second item, the task is… Read More
Given a 2D array arr[][] of size N * M, the value in arr[][] represents the value of coins, the task is to maximize the… Read More
Given a string  S of length N containing small-case English alphabets and an integer K, the task is to find the maximum possible length of… Read More
Given a binary tree and a target K, the task is to find the diameter of the minimum subtree having sum equal to K which… Read More
Given an array arr[] of size N and a given difference diff, the task is to count the number of partitions that we can perform… Read More
Given a string s of length N, and Q queries, each of type (K, C) where K is an integer C is a character, the… Read More
The term “Memoization” comes from the Latin word “memorandum” (to remember), which is commonly shortened to “memo” in American English, and which means “to transform… Read More
Given two arrays arr1[] and arr2[] of size N each, the task is to find the minimum number of interchange of the same indexed elements… Read More
Given a number N and a mapping of letters to each integer from 1 to 8, which are: {1: ‘abc’, 2: ‘def’, 3: ‘ghi’, 4: ‘jkl’,… Read More
Given a string S of length N, the task is to find the number of unique subsequences of the string for each length from 0… Read More
Given an array arr[] of N strings, and Q queries where each of the queries contains some characters, the task is to check if for… Read More
Recommended Solve DSA problems on GfG Practice. Solve Problems My Personal Notes arrow_drop_up Save

Start Your Coding Journey Now!