## Minimize number of unique characters in string

Given two strings A and B. Minimize the number of unique characters in string A by either swapping A[i] with B[i] or keeping it unchanged.… Read More »

Given two strings A and B. Minimize the number of unique characters in string A by either swapping A[i] with B[i] or keeping it unchanged.… Read More »

This is the variation of Rat in Maze A Maze is given as N*N binary matrix of blocks where source block is the upper left… Read More »

Place the numbers 1, 2, 3, 4, 5, 6, 7, 8 into the eight circles in the figure given below, in such a way that… Read More »

This article is about generating Power set in lexicographical order. Examples : Input : abc Output : a ab abc ac b bc c Recommended:… Read More »

Given three numbers sum S, prime P and N, find all N prime numbers after prime P such that their sum is equal to S.… Read More »

Given a number N and a digit D, we have to form an expression or equation that contains only D and that expression evaluates to… Read More »

Given n, of a n x n chessboard, find the proper placement of queens on chessboard. Previous Approach : N Queen Recommended: Please try your… Read More »

Newspapers and magazines often have crypt-arithmetic puzzles of the form: Examples: Input : s1 = SEND, s2 = “MORE”, s3 = “MONEY” Output : One… Read More »

Given a set of positive integers, find all its subsets. Examples: Input : 1 2 3 Output : // this space denotes null element. 1… Read More »

Given a number n, the task is to generate n bit Gray codes (generate bit patterns from 0 to 2^n-1 such that successive patterns differ… Read More »

Count the total number of ways or paths that exist between two vertices in a directed graph. These paths doesn’t contain a cycle, the simple… Read More »

The puzzle game Magnets involves placing a set of domino-shaped magnets (or electrets or other polarized objects) in a subset of slots on a board… Read More »

Given a string of digits, determine whether it is a ‘sum-string’. A string S is called a sum-string if a rightmost substring can be written… Read More »

Given an array of positive integers arr[] and a sum x, find all unique combinations in arr[] where the sum is equal to x. The… Read More »

Given a positive number n, we need to find all the combinations of 2*n elements such that every element from 1 to n appears exactly… Read More »