# Tag Archives: divisibility (adsbygoogle = window.adsbygoogle || []).push({});

## Check divisibility in a binary stream

Stream of binary number is coming, the task is to tell the number formed so far is divisible by a given number n. At any… Read More »

## Partition a number into two divisble parts

Given a number (as string) and two integers a and b, divide the string in two non-empty parts such that the first part is divisible… Read More »

## Count all sub-arrays having sum divisible by k

You are given an array of positive and/or negative integers and a value K . The task is to find count of all sub-arrays whose… Read More »

## Count natural numbers whose factorials are divisible by x but not y

Given two numbers x and y (x <= y), find out the total number of natural numbers, say i, for which i! is divisible by… Read More »

## Maximum path sum for each position with jumps under divisibility condition

Given an array of n positive integers. Initially we are at first position. We can jump to position y (1 <= x <= n) from… Read More »

## Smallest number divisible by first n numbers

Given a number n find the smallest number evenly divisible by each number 1 to n. Examples: Input : n = 4 Output : 12… Read More »

## Sub-string Divisibility by 11 Queries

Given a large number, n (having number digits up to 10^6) and various queries of the below form : Query(l, r) : find if the… Read More »

## Sub-string Divisibility by 3 Queries

Given a large number, n (having number digits up to 10^6) and various queries of the form : Query(l, r) : find if the sub-string… Read More »

## Check if a number is multiple of 9 using bitwise operators

Given a number n, write a function that returns true if n is divisible by 9, else false. The most simple way to check for… Read More »

## Find the largest multiple of 2, 3 and 5

An array of size n is given. The array contains digits from 0 to 9. Generate the largest number using the digits in the array… Read More »

## Find the largest multiple of 3 | Set 1 (Using Queue)

Given an array of non-negative integers. Find the largest multiple of 3 that can be formed from array elements. For example, if the input array… Read More »

## Check divisibility by 7

Given a number, check if it is divisible by 7. You are not allowed to use modulo operator, floating point arithmetic is also not allowed.… Read More »

## DFA based division

Deterministic Finite Automaton (DFA) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible,… Read More »

## Ugly Numbers

Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12,… Read More »