## Search element in a Spirally sorted Matrix

Given a spirally sorted matrix with N * N elements and an integer X, the task is to find the position of this given integer… Read More »

## Finding Floor and Ceil of a Sorted Array using C++ STL

Given a sorted array, the task is to find the floor and ceil of given numbers using STL. Examples: Input: arr[] = {1, 2, 4,… Read More »

## Count of Numbers such that difference between the number and sum of its digits not less than L

Given a Natural number N and a whole number L, the task is to find the count of numbers, smaller than or equal to N,… Read More »

## Distribute N candies among K people

Given N candies and K people. In the first turn, the first person gets 1 candy, the second gets 2 candies, and so on till… Read More »

## Minimum number N such that total set bits of all numbers from 1 to N is at-least X

Given a number X, the task is to find the minimum number N such that total set bits of all numbers from 1 to n… Read More »

## Number of subarrays have bitwise OR >= K

Given an array arr[] and an integer K, the task is to count the number of sub-arrays having bitwise OR ≥ K. Examples: Input: arr[]… Read More »

## Find the maximum possible value of the minimum value of modified array

Given an array of size and a number . The task is to modify the given array such that: The difference between the sum of… Read More »

## Minimum K such that every substring of length atleast K contains a character c

Given a string S containing lowercase latin letters. A character c is called K-amazing if every substring of S with length atleast K contains this… Read More »

## Minimum in an array which is first decreasing then increasing

Given an array of N integers where array elements form a strictly decreasing and increasing sequence. The task is to find the smallest number in… Read More »

## Lower Insertion Point

Given an array arr[] of n sorted integer elements and an integer X, the task is to find the lower insertion point of X in… Read More »

## Count numbers in a range having GCD of powers of prime factors equal to 1

Given a range represented by two positive integers L and R. The task is to count the numbers from the range having GCD of powers… Read More »

## Count numbers < = N whose difference with the count of primes upto them is > = K

Given two positive integers N and K, the task is to count all the numbers that satisfy the following conditions: If the number is num,… Read More »

## Binary Search a String

Given a sorted array of String and a String x, find index of x if it is present in the array. Examples: Input : arr[]… Read More »

## Ceiling of every element in same array

Given an array of integers, find the closest smaller or same element for every element. If all elements are greater for an element, then print… Read More »

## Floor of every element in same array

Given an array of integers, find the closest smaller or same element for every element. If all elements are greater for an element, then print… Read More »