## Maximize big when both big and small can be exchanged

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 »

## Minimum value to be added to X such that it is at least Y percent of N

Given three integers N, X and Y, the task is to find the minimum integer that should be added to X to make it at… Read More »

## Absolute difference between the first X and last X Digits of N

Given two integers N and X. The task is to print the absolute difference between the first X and last X digits in N. Considering… Read More »

## Count Odd and Even numbers in a range from L to R

Given two numbers L and R, the task is to count the number of odd numbers in the range L to R. Examples: Input: l… Read More »

## Cost of painting n * m grid

Given two integers n and m which are the dimensions of a grid. The task is to find the cost of painting the grid cell… Read More »

## Check if a binary string contains consecutive same or not

Given a binary string str consisting of characters ‘0’ and ‘1’. The task is to find whether the string is valid or not. A string… Read More »

## Smallest integer greater than n such that it consists of digit m exactly k times

Given three integer n, m and k, the task is to find the smallest integer > n such that digit m appears exactly k times… Read More »

## Increasing sequence with given GCD

Given two integers n and g, the task is to generate an increasing sequence of n integers such that: The gcd of all the elements… Read More »

## Check if a + b = c is valid after removing all zeroes from a, b and c

Given two integers a and b. Now, c can be found as a + b = c. The task is to check if the equation… Read More »

## Pizza Problem

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 »

## Program to check if a number is divisible by sum of its digits

Given an integer N, the task is to check whether the number is divisible by the sum of its digits or not. If divisible, then… Read More »

## Count the number of holes in an integer

Given an integer num, the task is to count the number of holes in that number. The holes in each digit are given below: Digit… Read More »

## Remove first X rows and columns from a matrix

Given an integer X and a square matrix mat[][], the task is to remove the first X rows and columns from the given matrix and… Read More »

## Water Game

Given an empty glass, this glass has to be filled with water and the task is to find the maximum amount of water that the… Read More »

## Python | Linear search on list or tuples

Let’s see a basic linear search operation on Python list and tuples. A simple approach is to do linear search, i.e Start from the leftmost… Read More »