## Find a point that lies inside exactly K given squares

Given an integer K and an array arr each of whose element x represents a square with two of its vertices as (0, 0) and… Read More »

## String which when repeated exactly K times gives a permutation of S

Given an integer K and a string str of lowercase English characters, the task is to find a string s such that when s is… Read More »

## Maximum length substring with highest frequency in a string

Given a string. The task is to find the maximum occurred substring with a maximum length. These occurrences can overlap. Examples: Input: str = “abab”… Read More »

## Sum of the digits of a number N written in all bases from 2 to N/2

Given an integer N, the task is to find the sum of the digits of the number N written in all the bases from 2… Read More »

## Sum of elements in an array having prime frequency

Given an array arr, the task is to find the sum of the elements which have prime frequencies in the array. Note: 1 is neither… Read More »

## Lexicographically Smallest Permutation of length N such that for exactly K indices, a[i] > a[i] + 1

Given two integers N and K, the task is to generate a permutation of N numbers (Every number from 1 to N occurs exactly once)… Read More »

## Minimum elements to be added in a range so that count of elements is divisible by K

Given three integer K, L and R (range [L, R]), the task is to find the minimum number of elements the range must be extended… Read More »

## Check if N can be represented as sum of integers chosen from set {A, B}

Given three integers N, A and B, the task is to find whether N can be represented as sum of A’s and B’s. Examples: Input:… Read More »

## Check if N is divisible by a number which is composed of the digits from the set {A, B}

Given three integers N, A and B, the task is to find whether N is divisible by any number that contains only A and B… Read More »

## Minimum number of increment/decrement operations such that array contains all elements from 1 to N

Given an array of N elements, the task is to convert it into a permutation (Each number from 1 to N occurs exactly once) by… Read More »

## Lexicographically smallest substring with maximum occurrences containing a’s and b’s only

Given a string ( containing characters from ‘0’ to ‘9’) and two digits and . The task is to find the substring in the given… Read More »

## Partiton N into M parts such that difference between Max and Min part is smallest

Given two integers N and M, partition N into M integers such that the difference between the maximum and minimum integer obtained by the partition… Read More »

## Minimum number of moves required to reach the destination by the king in a chess board

Given four integers sourceX, sourceY, destinationX and destinationY which represent the source and destination coordinates on a chessboard. The task is to find the minimum… Read More »

## Count of pairs in an array whose sum is a perfect square

Given an array of distinct elements, the task is to find the total number of two element pairs from the array whose sum is a… Read More »

## Split N^2 numbers into N groups of equal sum

Given an even number N. The task is to consider numbers from 1 to N2, split them into N groups of the equal sum. Examples:… Read More »