# Category Archives: Dynamic Programming

Given a 2D array plates[][] of size N, which each row representing the length and width of a N rectangular plates, the task is to… Read More
Given a positive integer X and an array arr[] consisting of N pairs, where each pair (A, B) represents a box, where A represents the… Read More
Given two integers N and K, the task is to find the total number of ways of representing N as the sum of positive integers… Read More
Given an array arr[] consisting of N binary strings, and two integers A and B, the task is to find the length of the longest… Read More
Given an array arr[] consisting of N integers, the task is to split the array into subarrays such that the sum of the difference between… Read More
Given an adjacency matrix adj[][] of an undirected graph consisting of N vertices, the task is to find whether the graph contains a Hamiltonian Path… Read More
Given an array arr[] consisting of N integers and an array Q[] consisting of M queries of the form {L, R}, the task for each… Read More
Given an array arr[] consisting of N binary strings, and two integers A and B, the task is to find the length of the longest… Read More
Given a binary string S and an array A[], both of size N, the task is to find the maximum score possible by removing substrings… Read More
Given two strings text and pattern of length M and N respectively, The task is to check if the pattern matches the text or not.… Read More
Given two positive integers N and S, the task is to count the number of unique outcomes possible when S flip operations are performed on… Read More
Given a binary matrix mat[][] that represents the adjacency matrix representation of a graph, where mat[i][j] as 1 represents that there is an edge between… Read More
Given an integer N representing the number of red and blue candies and a matrix mat[][] of size N * N, where mat[i][j] = 1… Read More
Given a string S, the task is to find the length of the longest increasing subsequence present in the given string. A sequence of characters… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the sum of the length of the two… Read More