There are two players A and B and some pots containing gold arranged in a line each containing some number of gold coins. At any
Tag: Arrays
Longest Palindromic Subsequence (DP-05)
You are given a string X of length m. You need to find the length of the longest subsequence of X which is palindrome.A subsequence
Longest common Subsequence (DP-04)
You are given two strings X and Y of lengths m and n. You need to find the length of the longest common subsequence. A
Longest common substring (DP-03)
You are given two strings X and Y with lengths m and n. You need to find the length of the longest common substring. Sample
Rod cutting problem (DP-02)
You are given a rod of length N units along with an array that contains the prices of all pieces of size smaller than N
Maximum Sum SubArray – Kadane’s Algorithm (DP-01)
Given an array which can contain both positive and negative integers, find the length of the subarray which has the maximum sum. Sample Input: [