Given two strings A and B of equal lengths consisting of lower case English letters. The task is to count the minimum number of pre-processing… Read More

# Tag Archives: programming-puzzle

Given N Big Candies and M Small Candies. One Big Candy can be bought by paying X small candies. Alternatively, one big candy can be… Read More

Two players are playing a series of games of Rock–paper–scissors. There are a total of K games played. Player 1 has a sequence of moves… Read More

Given 9 elements in a 3 x 3 matrix where the value of diagonals are 0. We need to find the values in diagonal to… Read More

Given an integer n, the task is to find the number of trailing zeros in the function i.e. f(n) = 11 * 22 * 33 *… Read More

Given an integer K and an array arr[] of N integers which contains the ids of the opened apps in a system where arr[0] is… Read More

Given an integer N and a pizza which can be cut into pieces, each cut should be a straight line going from the center of… Read More

Given a matrix mat[][] containing the characters [1 – 9], P and * where P is a person and * is an empty space. An… Read More

Given a string str containing only characters 0, 1, and 2, you can swap any two adjacent (consecutive) characters 0 and 1 or any two… Read More

Given a matrix mat[][] containing the characters Z, P and * where Z is a zombie, P is a plant and * is a bare… Read More

Given two integers n and m where n is the number of 0s and m is the number of 1s. The task is to print… Read More

Given an array A[] of size N / 2, the task is to construct the array B[] of size N such that: B[] is sorted… Read More

You have an unlimited number of 10-rupee coins and exactly one coin of r rupee and you need to buy minimum items each of cost… Read More

Given an array arr[] of n integers, construct a Sum Array sum[] (of same size) such that sum[i] is equal to the sum of all… Read More

Given three arrays names[], marks[] and updates[] where: names[] contains the names of students. marks[] contains the marks of the same students. updates[] contains the… Read More