## C++ program for Solving Cryptarithmetic Puzzles

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

## Backtracking to find all subsets

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

## A backtracking approach to generate n bit Gray Codes

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 all possible paths between two vertices

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 »

## Magnet Puzzle | Backtracking-9

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 »

## Check if a given string is sum-string

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 »

## Print all possible strings that can be made by placing spaces

Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them Examples :… Read More »

## Combinational Sum

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 »

## ABCO Interview Experience | Set 5

Round 1 15 Technical Aptitude (predominantly DS), 3 Queries, 2 Coding Question hosted in HackerRank Round 2 (F2F Technical Interview) Find the number of rotations… Read More »

## Paytm Interview Experience | Set 16

I was contacted by the HR on LinkedIn about the opening of Full Stack Developer at PayTM Noida. 1st Round (Duration – 2 hours) Tell… Read More »

## Accolite Interview Experience | Set 16 (On-Campus)

Round 1 (APTITUDE) : 20 mcqs in 30 minutes of time -0.25 negative marking Questions were from core computer science subjects and one blood relation… Read More »

## Combinations where every element appears twice and distance between appearances is equal to the value

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 »

## Top 20 Backtracking Algorithm Interview Questions

N Queens Problem Warnsdorff’s Algorithm Word Break Problem Remove Invalid Parenthesis Match a pattern and string using regular expression Find Path from corner cell to… Read More »

## Warnsdorff’s algorithm for Knight’s tour problem

Problem : A knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each… Read More »

## Printing all solutions in N-Queen Problem

The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two queens attack each other. For example,… Read More »