Given an array A[] of size N(1 ≤ N ≤ 105), consistingof positive integers, where the score of an index i in range [0, N… Read More

# Category Archives: Pattern Searching

Given an array arr[] of size N, the task is to construct an array brr[] of size N that satisfies the following conditions: In every… Read More

Given a string R(x) of length n representing an expression having the set of words under the given grammar: For every lowercase letter x, R(x)… Read More

Prerequisites: Z-algorithm Given a string S, the task is to find the maximum number of palindromes that can be formed after performing the given steps:… Read More

Given two integers i and j, the task is to print the i * j thmatrix element that can be obtained by filling the matrix… Read More

Given two integers L and R, the task is to find the count of numbers in the range [L, R] whose first and last digit… Read More

Given a string str, the task is to extract the substrings present between two delimiters, i.e. ‘[‘ and ‘]’. Examples: Input: str = “[This is… Read More

Given a positive integer N, the task is to find the smallest positive number made up of distinct digits having sum of its digits equal… Read More

Given a numeric string S representing a positive decimal integer, the task is to find the minimum number of positive Deci-Binary numbers required to obtain… Read More

Given two strings S1 and S2 of length N and M respectively, the task is to find the maximum value of times the string S2… Read More

Given two strings S and T of length N and M respectively, the task is to count the number of substrings of S that contains… Read More

Given a Binary string str of length N, the task is to find the last character removed from the string by repeatedly removing the first… Read More

Given a matrix with N rows and M columns, the task is to find the minimum replacements requried to make all rows and columns of… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the number of times the absolute difference between… Read More

Given three integers N, low and high, the task is to find the lexicographically largest bitonic sequence consisting of N elements lying in the range… Read More