Given two integers N and K, the task is to find the number of different arrays of size N that can be formed having the… Read More

# Category Archives: Dynamic Programming

Given N program codes and their respective debugging times in an array codeTime and an integer WorkingSessionTime, the ith program takes codeTime[i] hours to finish.… Read More

Given two arrays A[] and B[] consisting of N positive integers, the task is to find the total number of subsets of indices such that… Read More

Given a string S of size N consisting of digits and ?, the task is to find the number of strings formed such that replacing… Read More

Given three positive integers A, B, and K, the task is to find the Kth lexicographically smallest binary string that contains exactly A number of… Read More

Given an array arr[](1- based indexing) consisting of N integers and a positive integer K, the task is to find the minimum number of array… Read More

Given an array arr[] consisting of N integers and a positive integer X, the task is to count subsequences with GCD exactly X. Examples: Input:… Read More

A person wants to transfer bananas over to a destination A km away. He initially has B bananas and a camel. The camel cannot carry… Read More

Given two integers N and K, the task is to find the total number of possible binary array of size N such that the sum… Read More

Given a positive integer M and an array arr[] of size N and a few integers are missing in the array represented as -1, the… Read More

Given two integers L and R, the task is to find the count of integers in the range [L, R] such that the frequency of… Read More

Consider a 3 lane road of length N which includes (N + 1) points from 0 to N. A man starts at point 0 in… Read More

Given K buildings with N floors and a person standing on the ground who can make at most M jumps. The person has to climb… Read More

Go to CDN’s CopyGiven three integers N, M and P, the task is to find the total number of valid arrays that can be created… 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