Given a number N, the task is to count the combinations of K numbers from 1 to N having a sum equal to N, with… Read More

# Tag Archives: Memoization

Given two arrays array[] and multipliers[] of size N and M where N is always greater than equal to M. There are M operations to… Read More

Given an array arr[] consisting of permutation of the first N natural numbers, the task is to find the expected number of swaps to sort… Read More

Given three integers N, M and P, the task is to find the total number of valid arrays that can be created of size P… Read More

Given an array A[] of size N, the task is to find the maximum score possible of this array. The score of an array is… Read More

Given a positive integer N, the task is to find the number of all N-digit numbers whose adjacent digits have equal Greatest Common Divisor(GCD). Examples:… Read More

Given an array arr[] consisting of N positive integers such that arr[i] denotes the size of the ith group sitting in a donut shop and… Read More

Given a number K, and N bars of height from 1 to N, the task is to find the number of ways to arrange the… Read More

Given an array arr[] consisting of N integers and an integer M (initially 1), the task is to find the maximum sum of array elements… Read More

Given two numbers N and M, the task is to find the number of sorted arrays that can be formed of size M using first… 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 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