## Queries to count integers in a range [L, R] such that their digit sum is prime and divisible by K

Given Q queries and an integer K where each query consists of a range [L, R] and the task is to find the count of… Read More »

## Remove an element to minimize the LCM of the given array

Given an array arr[] of length N ≥ 2. The task is to remove an element from the given array such that the LCM of… Read More »

## Queries to find the count of vowels in the substrings of the given string

Given a string str of length N and Q queries where every query consists of two integers L and R. For every query, the task… Read More »

## Find the maximum element in the array other than Ai

Given an array arr[] of size N. The task is to find maximum element among N – 1 elements other than arr[i] for each i… Read More »

## Minimum number of substrings the given string can be splitted into that satisfy the given conditions

Given a string str and a string array arr[], the task is to find the minimum count of substrings this can be splitted into such… Read More »

## Find the longest sub-string which is prefix, suffix and also present inside the string | Set 2

Given string str. The task is to find the longest sub-string which is a prefix, a suffix and a sub-string of the given string, str.… Read More »

## Find number of triplets in array such that a[i]>a[j]>a[k] and i<j<k

Given an array arr of size N. The task is to count number of triplets in the array such that a[i]>a[j]>a[k] and i<j<k Examples: Input… Read More »

## Queries to print the character that occurs the maximum number of times in a given range

Given a string S of size N and Q queries. Every query consists of L and R ( 0 < = L < = R… Read More »

## Maximum number of given operations to remove the entire string

Given a string str containing lowercase English characters, we can perform the following two operations on the given string: Remove the entire string. Remove a… Read More »

## XOR in a range of a binary array

Given a binary array arr[] of size N and some queries. Each query represents an index range [l, r]. The task is to find the… Read More »

## Find the number of occurrences of a character upto preceding position

Given a string S of length N and an integer P(1≤P≤N) denoting the position of a character in the string. The task is to find… Read More »

## Find a partition point in array to maximize its xor sum

Given an array a of size N. The task is to find an index ‘i’ (1 <= i <= N) such that (a ^ …… Read More »

## Longest prefix in a string with highest frequency

Given a string, find a prefix with the highest frequency. If two prefixes have the same frequency then consider the one with maximum length. Examples:… Read More »

## Longest string in an array which matches with prefix of the given string

Given an array of strings arr[] and Q queries where each each query consists of a string str, the task is to find the longest… Read More »

## Find the maximum length of the prefix

Given an array arr[] of N integers where all elements of the array are from the range [0, 9] i.e. a single digit, the task… Read More »