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

# Tag Archives: Memoization

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 integer N, representing the number of stations lying between the source and the destination. There are three trains available from every station and… Read More

Given an array arr[] and an integer K, the 0th index, the task is to collect the maximum score possible by performing the following operations: … Read More

Given three arrays A[], B[] and C[] of size N and three positive integers X, Y, and Z, the task is to find the maximum… Read More

Given an integer N and an array maxDigit[], the task is to count all the distinct N-digit numbers such that digit i does not appear… Read More

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

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

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

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

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

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

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