# Tag Archives: prefix

Given two arrays A[] and B[] of size N each, the task is to find the number of elements in array B[] that occur before… Read More
Given a String ( S ) of length N and with that String, we need to print a triangle out of it. The triangle should… Read More
Given an array arr[] of length N consisting of uppercase English letters only and a letter ch. the task is to find the final array… Read More
Given an array A[] of N elements, the task is to create a Prefix-MEX array for this given array. Prefix-MEX array B[] of an array… Read More
Given a binary string S, the task is to make a binary string of size N from the given string S (don’t change the position… Read More
Given a string S of length N, the task is to remove the longest prefix of the string which has at least one duplicate substring… Read More
Given a string S of length N, the task is to find the length of the longest substring X of the string S such that:… Read More
Given two integers N, Y, generate a permutation of length N such that sum of all prefix minimum of that permutation is Y. Example:  Input:… Read More
Given an array arr[]of integers with length N and an integer X, the task is to calculate the number of subarrays with median greater than… Read More
Given an array arr[], the task is to calculate the total number of indices where all elements in the left part is less than all… Read More
Given K (K > 2) arrays of different sizes in a 2D list arr[][] where elements in each array are non-negative. Find the minimum common… Read More
Given string str having N characters representing an integer, the task is to calculate the sum of all possible prefixes of the given string. Example:… Read More
Given two arrays A[] and B[] of size N each, the task is to minimize A[i] + B[j] such that j ≥ i. Examples: Input:… Read More
Given a string str and an array of words word[], the task is to find whether str is a prefix string of word[]. Examples: Input:… Read More
Given an array arr consisting of N elements and Q queries of the following two types:   1 K: For this type of query, the array… Read More