# Tag Archives: Modular Arithmetic

Given integers A and K, there are A boxes the first box contains K balls, the Second box contains K + 1 balls, the Third… Read More
Given integers X and Y representing X girls and Y boys, the task is to count the number of ways arranging X girls and Y… Read More
Given two positive integers X and Y (1 ≤ Y ≤ 105), find the maximum positive multiple (say M) of X such that M is… Read More
Given an array arr[] of size N, the task is to minimize the number of distinct elements in the array after performing the following operation… Read More
Given two positive integers num1 and num2, the task is to find the product of the two numbers on a 12-hour clock rather than a… Read More
Given two arrays A[] and B[] of length N and M respectively and a prime number X, the task is to find the number of… Read More
Given an integer N, the task is to find the minimum and the maximum number of terms required to divide N as the sum of… Read More
Given three numbers n, r and p, the task is to compute the value of nCr % p. Note: p is a square-free number and… Read More
Given two integers N representing the dimension of a square matrix and an integer A with which the matrix is initialized. Given another integer mod.… Read More
Given two integers N and M (1 ≤ N, M ≤ 100) denoting the total number of 1s and 0s respectively. The task is to… Read More
Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples:  Input: 9->4->6 8->4 Output: 79464… Read More
Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples:  Input: 9->4->6 8->4 Output: 79464… Read More
Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples:  Input: 9->4->6 8->4 Output: 79464… Read More
Given two numbers represented by linked lists, write a function that returns the multiplication of these two linked lists. Examples:  Input: 9->4->6 8->4 Output: 79464… Read More
Given an array A[] of size N. Solve Q queries. Find the product in the range [L, R] under modulo P ( P is Prime). … Read More