## Subarray permutation that satisfies the given condition

Given a permutation of integers from 1 to N and an integer M, the task is to check if any subarray of the given permutation… Read More »

## Find the number of p-sided squares in a grid with K blacks painted

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

## Count number of pairs in array having sum divisible by K | SET 2

Given an array A[] and positive integer K, the task is to count the total number of pairs in the array whose sum is divisible… Read More »

## Kotlin Hashmap

Kotlin HashMap is a collection which contains pairs of object. Kotlin Hash Table based implementation of the MutableMap interface. It stores the data in the… Read More »

## Find minimum difference between any two elements | Set 2

Given an unsorted array arr[] of size n, the task is to find the minimum difference between any pair in the given array. Input: arr[]… Read More »

## Count number of distinct substrings of a given length

Given a string S of length N consisting of lower-case English albhabets and an integer ‘l’, find the number of distinct sub-strings of length ‘l’… Read More »

## Queries to check if string B exists as substring in string A

Given two strings A, B and some queries consisting of an integer i, the task is to check whether the sub-string of A starting from… Read More »

## Rearrange given string to maximize the occurrence of string t

Given two binary strings s and t. The task is to rearrange the string s in such a way that the occurrence of string t… Read More »

## Sum of all odd frequency nodes of the Linked List

Given a linked list, the task is to find the sum of all the odd frequency nodes from the given linked list. Examples: Input: 8… Read More »

## Count pairs with average present in the same array

Given an array arr[] of N integers where |arr[i] ≤ 1000| for all valid i. The task is to count the pairs of integers from… Read More »

## Distinct pairs from given arrays (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number

Given two arrays a[] and b[], the task is to count the pairs (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number.Note that… Read More »

## Minimum cost to modify a string

Given a string str consisting of lower case alphabets only and an integer K. The task is to find the minimum cost to modify the… Read More »

## Number of times the given string occurs in the array in the range [l, r]

Given an array of strings arr[] and two integers l and r, the task is to find the number of times the given string str… Read More »

## Total distinct pairs from two arrays such that second number can be obtained by inverting bits of first

Given two arrays arr1[] and arr2[], the task is to take an element from first array (say a) and one element from second array (say… Read More »

## Check if a given number divides the sum of the factorials of its digits

Given an integer N, the task is to check whether N divides the sum of the factorials of its digits. Examples: Input: N = 19… Read More »