## Meta Strings (Check if two strings can become same after a swap in one string)

Given two strings, the task is to check whether these strings are meta strings or not. Meta strings are the strings which can be made… Read More »

## Count of strings that can be formed using a, b and c under given constraints

Given a length n, count the number of strings of length n that can be made using ‘a’, ‘b’ and ‘c’ with at-most one ‘b’… Read More »

## Allocate minimum number of pages

Given number of pages in n different books and m students. The books are arranged in ascending order of number of pages. Every student is… Read More »

## Check if a Binary Tree contains duplicate subtrees of size 2 or more

Given a Binary Tree, check whether the Binary tree contains a duplicate sub-tree of size 2 or more. Note : Two same leaf nodes are… Read More »

## Find all triplets with zero sum

Given an array of distinct elements. The task is to find triplets in array whose sum is zero. Examples : Input : arr[] = {0,… Read More »

## Boggle | Set 2 (Using Trie)

Given a dictionary, a method to do a lookup in the dictionary and a M x N board where every cell has one character. Find… Read More »

## Unbounded Knapsack (Repetition of items allowed)

Given a knapsack weight W and a set of n items with certain value vali and weight wti, we need to calculate minimum amount that… Read More »

## Word Break Problem using Backtracking

Given a valid sentence without any spaces between the words and a dictionary of valid English words, find all possible ways to break the sentence… Read More »

## Generate all binary strings from given pattern

Given a string containing of ‘0’, ‘1’ and ‘?’ wildcard characters, generate all binary strings that can be formed by replacing each wildcard character by… Read More »

## Maximum absolute difference between sum of two contiguous sub-arrays

Given an array of integers, find two non-overlapping contiguous sub-arrays such that the absolute difference between the sum of two sub-arrays is maximum. Example: Input:… Read More »

## Inplace rotate square matrix by 90 degrees | Set 1

Given an square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space. Examples : Input 1 2 3 4 5… Read More »

## Shortest path in a Binary Maze

Given a MxN matrix where each element can either be 0 or 1. We need to find the shortest path between a given source cell… Read More »

## Hungarian Algorithm for Assignment Problem | Set 1 (Introduction)

Let there be n agents and n tasks. Any agent can be assigned to perform any task, incurring some cost that may vary depending on… Read More »

## Modular Exponentiation (Power in Modular Arithmetic)

Given three numbers x, y and p, compute (xy) % p. Examples : Input: x = 2, y = 3, p = 5 Output: 3… Read More »

## Print all Jumping Numbers smaller than or equal to a given value

A number is called as a Jumping Number if all adjacent digits in it differ by 1. The difference between ‘9’ and ‘0’ is not… Read More »