Given an integer array arr[] and an integer K (greater than 0), the task is to count the subarray whose elements sum up to a multiple of K, else print -1. A ...read more
Given a Binary String S of length N which consists of only 0 and 1, the task is to remove minimum number of 0’s from the string such that all 1’s form ...read more
Given a sorted array arr, remove the duplicates in the array itself such that duplicates appear at most twice in the given array arr and print the new length and modified array ...read more
Given an array of size N, print the index of the distinct element from the array, provided the array has only one distinct element and rest other elements are same. Examples: Input: ...read more
Given a square matrix of n order in which two positions are filled. Fill two more positions such that a rectangle is formed by joining all points. Examples: Input: n=4 Matrix[][]= 1 ...read more
Given two lowercase alphabet strings s and t return whether you can create a 1-to-1 mapping for each letter in s to another letter (could be the same letter) such that s ...read more
The min-product of an array is equal to the minimum value in the array multiplied by the array’s sum. For example, the array [3,2,5] (minimum value is 2) has a min-product of ...read more
Given an array of distinct positive integers arr[] of length N, the task is to count all the number of pairs of indices (i , j) such that a[j]−a[i] = j−i given ...read more
Given an integer array nums, return the sum of floor(nums[i] / nums[j]) for all pairs of indices 0 <= i, j < nums.length in the array. The floor() function returns the integer ...read more
In a country some special kinds of coins are available. The coin’s value is decided by a rule, that the values of the coins are first N positive odd numbers. As an ...read more