Assign Mice to Holes

There are N Mice and N holes placed in a straight line. Each hole can accommodate only 1 mouse. A mouse can stay at his […]

Coin Change Problem. Greedy Solution

Find min number of currency notes that we need to give for a given change. The following Video discusses the Greedy solution. If you want […]

Rectangles in a matrix

Given a character matrix in which some of the cells have alphabets written on them while other cells are empty (empty cells contains character ‘-‘ […]

Flip all zeros to ones

Given a string of bits and a number k. In one flip, you can toggle k consecutive characters, how many flips are required to change the entire string […]