## Minimum cost to reverse edges such that there is path between every pair of nodes

Given a connected, directional graph. Each node is connected to exactly two other nodes. There is weight associated with each edge denoting the cost to… Read More »

## Count of indices in an array that satisfy the given condition

Given an array arr[] of N positive integers, the task is to find the count of indices i such that all the elements from arr[0]… Read More »

## Minimum inversions required so that no two adjacent elements are same

Given a binary array arr[] of size N. The task is to find the minimum number of inversions required so that no two adjacent elements… Read More »

## Sum of all the numbers present at given level in Modified Pascal’s triangle

Given a level N, the task is to find the sum of all the integers present at this given level in an Alternating Pascal’s triangle.… Read More »

## Maximum possible sum after M operations on N cards

Given an array arr[] of size N which represents the initial number on each card and given a two dimensional array B[][] of size M… Read More »

## Maximum possible GCD after replacing at most one element in the given array

Given an array arr[] of size N > 1. The task is to find the maximum possible GCD of the array by replacing at most… Read More »

## Maximum possible array sum after performing the given operation

Given an array arr[] of size N, the task is to find the maximum sum of the elements of the array after applying the given… Read More »

## Transportation Problem | Set 5 ( Unbalanced )

An introduction to the transportation problem has been discussed in this article. In this article, the method to solve the unbalanced transportation problem will be… Read More »

## Sum of products of all possible K size subsets of the given array

Given an array arr[] of N non-negative integers and an integer 1 ≤ K ≤ N. The task is to find the sum of the… Read More »

## Find the subsequence with given sum in a superincreasing sequence

A sequence of positive real numbers S1, S2, S3, …, SN is called a superincreasing sequence if every element of the sequence is greater than… Read More »

## Minimum number of edges that need to be added to form a triangle

Given an undirected graph with N vertices and N edges. No two edges connect the same pair of vertices. A triangle is a set of… Read More »

## Sum of all the prime numbers with the maximum position of set bit ≤ D

Given an integer D, the task is to find the sum of all the prime numbers whose maximum position of set bits (farthest set bit… Read More »

## Optimal Strategy for a Game | Special Gold Coin

Given a row of silver coins among which a special gold coin is present. Two players play the game, and with each move, a player… Read More »

## Check if B can be formed by permuting the binary digits of A

Given two integer A and B, the task is to check whether the binary representation of B can be generated by permuting the binary digits… Read More »

## Transportation Problem | Set 1 (Introduction)

Transportation problem is a special kind of Linear Programming Problem (LPP) in which goods are transported from a set of sources to a set of… Read More »