## Find smallest number K such that K % p = 0 and q % K = 0

Given two integers p and q, the task is to find the smallest number K such that K % p = 0 and q %… Read More »

- Count number of binary strings without consecutive 1’s : Set 2
- Minimum window size containing atleast P primes in every window of given range
- tgamma() method in C/C++ with Examples
- Count numbers less than N containing digits from the given set : Digit DP
- Count of interesting primes upto N
- Transform N to Minimum possible value
- Find minimum value of the expression by choosing K elements from given array
- Check if an array can be formed by merging 2 non-empty permutations
- Check if N contains all digits as K in base B
- fpclassify() method in C/C++ with Examples

Given two integers p and q, the task is to find the smallest number K such that K % p = 0 and q %… Read More »

Given a grid N x M size and initial position (X, Y) and a series of K moves. Each move contains 2 integers Dx and… Read More »

Given three integers X, Y and N, the task is to find the Nth term of the series f[i] = f[i – 1] – f[i… Read More »

Given three integers A, B and C, the task is to find the count of values of X such that the following condition is satisfied,… Read More »

Given an array A containing N elements (N is divisible by 3), the task is to split the numbers into groups of 3, let the… Read More »

Given an array containing N elements, each element is either 1 or 2. The task is to find out whether the array can be divided… Read More »

Given two numbers and . Find the values of X and Y in the equations. A = X + Y B = X xor Y… Read More »

Given N points in 2 dimensional space. The task is to count the number of triplets pairs (A, B, C) such that point B is… Read More »

Given two string A and B which represents two integers, the task is to print the maximized value of A after replacing 0 or more… Read More »

Given two strings a and b, the task is to count the number of common divisors of both the strings. A string s is a… Read More »

Given an integer N. The task is to find the maximum possible sum of intermediate values (Including N and 1) attained after applying the beow… Read More »

Given an array arr[] of n integers and an integer k. The task is to make all the elements of arr[] equal with the given… Read More »

Given an integer N, the task is to find out whether it can be written as a sum of 2 triangular numbers (which may or… Read More »

Given integers n, a, b and c, the task is to find the maximum value of x + y + z such that ax +… Read More »

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 »