## Maximize the binary matrix by filpping submatrix once

Given a binary matrix of R rows and C columns. We are allowed flip to any size of sub matrix. Flipping means changing 1 to… Read More »

## Sort elements by frequency | Set 4 (Efficient approach using hash)

Print the elements of an array in the decreasing frequency if 2 numbers have same frequency then print the one which came first. Examples: Input… Read More »

## Minimum Perimeter of n blocks

We are given n blocks of size 1 x 1, we need to find the minimum perimeter of the grid made by these blocks. Examples… Read More »

## How to make Mergesort to perform O(n) comparisons in best case?

As we know, Mergesort is a divide and conquer algorithm that splits the array to halves recursively until it reaches an array of the size… Read More »

## Check if there is a cycle with odd weight sum in an undirected graph

Given a weighted and undirected graph, we need to find if a cycle exist in this graph such that the sum of weights of all… Read More »

## Scheduling priority tasks in limited time and minimizing loss

Given n tasks with arrival time, priority and number of time units they need. We need to schedule these tasks on a single resource. The… Read More »

## Check if a number is power of 8 or not

Given a number check whether it is power of 8 or not. Examples : Input : n = 64 Output : Yes Input : 75… Read More »

## Median of Stream of Running Integers using STL

Given that integers are being read from a data stream. Find median of all the elements read so far starting from the first integer till… Read More »