## Find the maximum number of composite summands of a number

Given an integer N(1<=N<=10^9). The task is to represent N as a sum of the maximum possible number of composite summands and print this maximum… Read More »

## Number of ways of scoring R runs in B balls with at most W wickets

Given three integers R, B and W which denote the number of runs, balls and wickets. One can score 0, 1, 2, 3, 6 or… Read More »

## Minimum cost to reach end of array array when a maximum jump of K index is allowed

Given an array arr[] of N integers and an integer K, one can move from an index i to any other j if j ≤… Read More »

## Maximum sum from three arrays such that picking elements consecutively from same is not allowed

Given three arrays A[], B[] and C[] of N integers. We can choose N elements from these array such that for every index i only… Read More »

## Minimum steps to delete a string by deleting substring comprising of same characters

Given a string str. You are allowed to delete only some contiguous characters if all the characters are same in a single operation. The task… Read More »

## Number of ways to make binary string of length N such that 0s always occur together in groups of size K

Given two integers N and K, the task is to count the number of ways to make a binary string of length N such that… Read More »

## Minimal product subsequence where adjacent elements are separated by a maximum distance of K

Given an array arr[] and an integer K, the task is to find out the minimum product of a subsequence where adjacent elements of the… Read More »

## Number of n digit stepping numbers | Space optimized solution

Given n, find count of n digit Stepping numbers. A number is called stepping number if all adjacent digits have an absolute difference of 1.… Read More »

## Minimum cost to form a number X by adding up powers of 2

Given an array arr[] of N integers and an integer X. Element arr[i] in array denotes the cost to use 2i. The task is to… Read More »

## Longest path in a directed Acyclic graph | Dynamic Programming

Given a directed graph G with N vertices and M edges. The task is to find the length of the longest directed path in Graph.… Read More »

## Sum of all even factors of numbers in the range [l, r]

Given a range [l, r], the task is to find the sum of all the even factors of the numbers from the given range. Examples:… Read More »

## Largest subset of rectangles such that no rectangle fit in any other rectangle

Given height and width of N rectangles. The task is to find the size of the largest subset such that no pair of rectangles fit… Read More »

## Number of ways to pair people

Given that there are p people in a party. Each person can either join dance as a single individual or as a pair with any… Read More »

## Ways to form a group from three groups with given constraints

Given three numbers(x, y and z) which denote the number of people in the first group, the second group, and third group. We can form… Read More »

## Maximum subarray sum by flipping signs of at most K array elements

Given an array arr[] of N integers and an integer K. The task is to find the maximum sub-array sum by flipping signs of at… Read More »