# Tag Archives: Memoization

## Number of Longest Increasing Subsequences

Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array. Examples: Input:… Read More »

## Length of the longest increasing subsequence which does not contain a given sequence as Subarray

Given two arrays arr[] and arr1[] of lengths N and M respectively, the task is to find the longest increasing subsequence of array arr[] such… Read More »

## Minimum length of Run Length Encoding possible by removing at most K characters from a given string

Given a string S of length N, consisting of lowercase English alphabets only, the task is to find the minimum possible length of run-length-encoding that… Read More »

## Maximize sum by selecting M elements from the start or end of rows of a Matrix

Given a 2D array Blocks[][] consisting of N rows of variable length. The task is to select at most M elements with the maximum possible… Read More »

## Find the last remaining element after repeated removal of odd and even indexed elements alternately

Given a positive integer N, the task is to print the last remaining element from a sequence [1, N] after repeatedly performing the following operations… Read More »

## Count ways to obtain given sum by repeated throws of a dice

Given an integer N, the task is to find the number of ways to get the sum N by repeatedly throwing a dice. Examples: Input:… Read More »

## Minimum Steps to obtain N from 1 by the given operations

Given an integer N, the task is to find the minimum number of operations needed to obtain the number N starting from 1. Below are… Read More »

## Smallest subarray from a given Array with sum greater than or equal to K | Set 2

Given an array A[] consisting of N positive integers and an integer K, the task is to find the length of the smallest subarray with… Read More »

## Minimum cost to convert M to N by repeated addition of its even divisors

Given two integers M and N, the task is to find the minimum cost to convert M to N by repetitive addition of even divisors… Read More »

## Print Longest Bitonic subsequence (Space Optimized Approach)

Given an array arr[] of size N, the task is to print the longest bitonic subsequence of the given array.Note: If more than one solution… Read More »

## Maximize sum of pairwise products generated from the given Arrays

Given three arrays arr1[], arr2[] and arr3[] of length N1, N2 and N3 respectively, the task is to find the maximum sum possible by adding… Read More »

## Minimum pair merge operations required to make Array non-increasing

Given an array A[], the task is to find the minimum number of operations required in which two adjacent elements are removed from the array… Read More »

## Count of Ways to obtain given Sum from the given Array elements

Given an array arr[], consisting of N non-negative integers and an integer S, the task is to find the number of ways to obtain the… Read More »

## Maximum Subarray Sum possible by replacing an Array element by its Square

Given an array a[] consisting of N integers, the task is to find the maximum subarray sum that can be pbtained by replacing a single… Read More »

## Maximize the Sum of a Subsequence from an Array based on given conditions

Given an array a[] consisting of N integers, the task is to perform the following operations:   Select a subsequence and for every pth element of… Read More »