# Category Archives: Competitive Programming (adsbygoogle = window.adsbygoogle || []).push({});

## Number of blocks in a chessboard a knight can move to in exactly k moves

Given integers i, j, k and n where (i, j) is the initial position of the Knight on a n * n chessboard, the task… Read More »

## Number of ways to swap two bit of s1 so that bitwise OR of s1 and s2 changes

Given two binary numbers strings and of length . Find the number of ways of swapping two bits in s1(only s1 not s2) so that… Read More »

## Probability of getting more value in third dice throw

Given that the three players playing a game of rolling a dice. Player1 rolled a dice got A and player2 rolled a dice got B.… Read More »

## Check if a large number is divisible by 75 or not

Given a very large number in the form of a string, the task is to check if the number is divisible by 75 or not.… Read More »

## Find all numbers that divide maximum array elements

Given an array of N numbers, the task is to print all the numbers greater than 1 which divide the maximum of array elements. Examples:… Read More »

## Sum of common divisors of two numbers A and B

Given two number A and B, the task is to find the sum of common factors of two numbers A and B. The numbers A… Read More »

## Print a case where the given sorting algorithm fails

Given an integer N, the task is to find N elements which fail the below-sorting algorithm. If none of the N elements fail, then print… Read More »

## Sum of multiples of A and B less than N

Given a number N, the task is to find the sum of all the multiples of A and B below N. Examples: Input:N = 11,… Read More »

## Find the missing elements from 1 to M in given N ranges | Set-2

Given an integer and ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within the range that… Read More »

## Sum of first N natural numbers which are not powers of K

Given two integers and , the task is to find the sum of all the numbers within the range [1, n] excluding the numbers which… Read More »

## Check if a number is formed by Concatenation of 1, 14 or 144 only

Given a number . The task is to check if the number is formed by concatenating the numbers 1, 14 and 144 only any number… Read More »

## Check whether the frequencies of all the characters in a string are prime or not

Given a string , the task is to check if the frequencies of all the characters of the string are prime or not. If all… Read More »

## Find the index of the left pointer after possible moves in the array

Given an array of size . Move two pointers, one from the left side and one from the right side of the array, a pointer… Read More »

## Probability of getting two consecutive heads after choosing a random coin among two different types of coins

Given two coins which have probability of getting heads p% and q% respectively, the task is to determine the probability of getting two consecutive heads… Read More »

## Find the number of primitive roots modulo prime

Given a prime . The task is to count all the primitive roots of . A primitive root is an integer x (1 <= x… Read More »