# Tag Archives: divisibility

## Longest subarray in which all elements are a factor of K

Given an array A[] of size N and a positive integer K, the task is to find the length of the longest subarray such that… Read More »

## Smallest submatrix required to be removed such that sum of the remaining matrix is divisible by K

Given a 2D matrix mat[][] of size N * M and a positive integer K, the task is to find the area of the smallest… Read More »

## Count subsets having product divisible by K

Given an array arr[] of size N and an integer K, the task is to count the number of subsets from the given array with… Read More »

## Check if decimal representation of Binary String is divisible by 9 or not

Given a binary string S of length N, the task is to check if the decimal representation of the binary string is divisible by 9… Read More »

## Kth number exceeding N whose sum of its digits divisible by M

Given the integers N, K and M, the task is to find the Kth number greater than N whose sum of digits is divisible by… Read More »

## Maximize trailing zeros in product from top left to bottom right of given Matrix

Given a matrix mat[][] of dimensions N * M, the task is to print the maximum number of trailing zeros that can be obtained in the… Read More »

## Count three-digit numbers having difference X with its reverse

Given an integer X, the task is to count the total number of three-digit numbers having difference X with its reverse. If no such number… Read More »

## Count Full Prime numbers in a given range

Given two integers L and R, the task is to count the number of full prime numbers that are present in the given range. A… Read More »

## Check if a given array can be divided into pairs with even sum

Given an array arr[] consisting of N integers, the task is to check if it is possible to divide the entire array into pairs such… Read More »

## Length of longest subsequence having absolute difference of all pairs divisible by K

Given an array, arr[] of size N and an integer K, the task is to find the length of the longest subsequence from the given… Read More »

## Longest Subsequence from a numeric String divisible by K

Given an integer K and a numeric string str, the task is to find the longest subsequence from the given string which is divisible by… Read More »

## Subarray of length K having concatenation of its elements divisible by X

Given an array arr[] consisting of N positive integers, the task is to find a subarray of length K such that concatenation of each element… Read More »

## Count N digits numbers with sum divisible by K

Given two integers N and K, the task is to count all N digits numbers whose sum of digits is divisible by K. Examples:  Input:… Read More »

## Reduce a given number to form a key by the given operations

Given an integer N, the task is to reduce the number and form a key by following the operations given below: Extract the Most Significant… Read More »

## Check if a subarray of size K exists whose elements form a number divisible by 3

Given an array arr[], of size N and a positive integer K, the task is to find a subarray of size K whose elements can… Read More »