Home Practice Programming

Practice Programming

Count all possible paths between two vertices of a directed graph

Given a directed graph G, and two vertices: start s & end e, count all possible way of reaching the vertex e from vertex...

Minimum number of swaps required to sort a given array

Problem Statement: Given an array of n distinct elements, we have to find the minimum number of swaps required to sort the given array. Example...

Detect Cycle in a Directed Graph

We are given a directed graph with V vertices and we have to find whether this directed graph contains a cycle or not. A cycle...

Maximize the number of cut segments of length x, y and z

We are given a rod of length L, our task is to cut the rod into segments of x, y & z such that...

Wildcard Pattern Matching using Dynamic Programming

Wildcard Pattern Matching - Given a text of length n and a wildcard pattern of length m, we are supposed to find whether the...

Largest Rectangular Area in a given Histogram

Given a histogram find the largest rectangle (rectangular area) that can be made out of the number of contiguous bars, assuming that every bar...

Find whether a given array is a subset of another array

We are given two arrays, arr1 and arr2, that contains n, m number of distinct elements in unsorted order. We are supposed to find,...

Find all triplets such that sum of two equals to third element

We are given an array of n distinct integers and we have to find all triplets (3 elements), such that the sum of two...

DP – Coin Change: Find number of ways of representing n cents

Given an infinite supply of 25 cents, 10 cents, 5 cents, and 1 cent. Find the number of ways of representing n cents. (The...

Rotate a matrix by 90 degrees in the clockwise direction

We are given an NxN matrix and we have to rotate it by 90 degrees in a clockwise direction without using any extra space. Input: 10 11 12...

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

We promise, we won't spam
Even we hate spam as much