## Maximum possible remainder when an element is divided by other element in the array

Given an array arr[] of N integers, the task is to find the maximum mod value for any pair (arr[i], arr[j]) from the array. Examples:… Read More »

Given an array arr[] of N integers, the task is to find the maximum mod value for any pair (arr[i], arr[j]) from the array. Examples:… Read More »

Given a string str consisting of lowercase characters, the task is to check whether the string is divisible by 6 after changing it according to… Read More »

Given a string S consisting of a large hexadecimal number, the task is to check its divisibility by a given decimal number M. If divisible… Read More »

Given an array A[] of N integers, the task is to generate an array B[] such that B[i] contains the count of indices j in… Read More »

Given an array arr[] of size N consisting of non-zero positive integers. The task is to determine whether the number that is formed by selecting… Read More »

Given a large integer X represented as an array arr[] where each arr[i] stores a digit in X. The task is to check whether the… Read More »

Given an integer array arr of size N. The task is to find the maximum possible elements in the array which are divisible by 2… Read More »

Given a binary string str of length N and two integers A and B such that 0 ≤ A < B < n. The task… Read More »

Given a binary string str, the task is to find the largest power of 2 that divides the decimal equivalent of the given binary number.… Read More »

There are two players P1 and P2 and two piles of coins consisting of M and N coins respectively. At each turn, a player can… Read More »

Given two numbers N and M, the task is to find the highest power of M that divides N. Note: M > 1 Examples: Input:… Read More »

Given an integer N ≥ 1, the task is to find the smallest N digit number which is a multiple of 5. Examples: Input: N… Read More »

Given an integer N, the task is to check whether the product of first N natural numbers is divisible by the sum of first N… Read More »

Given a number N. At every step, subtract the largest perfect square( ≤ N) from N. Repeat this step while N > 0. The task… Read More »

Given an array of N numbers. Two players X and Y play a game where at every step one player selects a number. One number… Read More »