Skip to content

Category Archives: Mathematical

Given an array arr[] of size N, the task is to check if it is possible to convert all of the array elements to a… Read More
Given a sequence Y of size N where:  Yi = gcd(X1, X2, X3, . . ., Xi ) of some sequence X.  The task is… Read More
Given K permutations of numbers from 1 to N in a 2D array arr[][]. The task is to find the longest common subsequence of these… Read More
Given an array arr[] of integers of size N where each element can be in the range [1, M], and two integers X and K.… Read More
Given two integers N and K. The task is to count all positive integers with length N having an absolute difference between adjacent digits equal… Read More
Given an array arr[] of size N consisting of non-negative integers. In one move ith index element of the array is decreased by 1 and… Read More
Given two arrays W[] and C[] containing weight and cost of N (1 to N) items respectively, and an integer K, find a segment from… Read More
Given an array arr[] containing N integers and an array queries[] containing Q queries in the form of {L, R}, the task is to count… Read More
Given two integers L and B representing the length and breadth of a rectangle and a coordinate (X, Y) representing a point on the cartesian… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
Given a large positive number as string, count all rotations of the given number which are divisible by 8. Examples:  Input: 8 Output: 1 Input:… Read More
Given an array arr[] of size N and an integer K. The task is to find the largest K digit number divisible by all number… Read More