## Minimum number of operations required to reduce N to 1

Given an integer element ‘N’, the task is to find the minimum number of operations that need to be performed to make ‘N’ equal to… Read More »

## Check whether sum of digits at odd places of a number is divisible by K

Given two integer ‘N’ and ‘K’, the task is to find the sum of digits of ‘N’ at it’s odd places (right to left) and… Read More »

## Longest subarray with elements divisible by k

Suppose you a given an array. You have to find the length of the longest subarray such that each and every element of it is… Read More »

## Sum of greatest odd divisor of numbers in given range

Given an interval of integers [A, B]. For each number in this interval compute its greatest odd divisor. Output the sum of these divisors. Examples:… Read More »

## Round to next greater multiple of 8

Given an unsigned integer x. Round it up to the next greater multiple of 8 using bitwise operations only. Examples: Input : 35 Output :… Read More »

## Round to next smaller multiple of 8

Given an unsigned integer x. Round it down to the next smaller multiple of 8 using bitwise operations only. Examples: Input : 35 Output :… Read More »

## Program to find count of numbers having odd number of divisors in given range

Given two integers A and B. The task is to count how many numbers in the interval [ A, B ] have an odd number… Read More »

## Check if there is any pair in a given range with GCD is divisible by k

Given a range, we need to check if is their any pairs in the segment whose GCD is divisible by k. Examples: Input : l=4,… Read More »

## Program to find Nth term divisible by a or b

Given two integers and . The task is to find the Nth term which is divisible by either of or . Examples : Input :… Read More »

## Rearrange all elements of array which are multiples of x in increasing order

Given an array of integers ‘arr’ and a number x, the task is to sort all the elements which are multiples of x of the… Read More »

## Sum of first N natural numbers which are divisible by 2 and 7

Given a number N. The task is to find the sum of all those numbers from 1 to N that are divisible by 2 or… Read More »

## Highest power of two that divides a given number

Given a number n, find the highest power of 2 that divides n. Examples: Input : n = 48 Output : 16 Highest power of… Read More »

## Maximum count of equal numbers in an array after performing given operations

Given an array of integers. The task is to find the maximum count of equal numbers in an array after applying the given operation any… Read More »

## Minimum and Maximum element of an array which is divisible by a given number k

Given an array, the task is to find the minimum and maximum elements in the array which is divisible by a given number k. Examples:… Read More »

## Largest number divisible by 90 that can be made using 0 and 5

Given an array containing N elements. Each element is either 0 or 5. Find the largest number divisible by 90 that can be made using… Read More »