Skip to content

Category Archives: Pattern Searching

Given a string S and an array of equal length words (strings) arr[]. The task is to find the minimum start index of the substring… Read More
Given a positive integer N and an array arr[] of size K consisting of binary string where each string is of size N, the task… Read More
Given the order of the matrix N and M, and a source location (X, Y), the task is to find all the coordinates of the… Read More
Given an array arr[] of size N, where arr[i] is natural numbers less than or equal to N, the task is to find all the… Read More
Given an array arr[ ] of size N, the task is find minimum number of operation required to make mean of Array arr[ ] equal… Read More
Given a string str[] of size N, the task is to encode it in such a way that the last occurrence of each character occurs… Read More
Given a string S, the task is to divide the characters of S to form minimum number of palindromic strings. Note: There can be multiple… Read More
Given an array A[] consisting of N integers, the task is to check if it is possible to reduce array of at least length 2… Read More
Given two Binary strings, S1 and S2, the task is to generate a new Binary strings (of least length possible) which can be stated as… Read More
Given three integers, C0, C1 and C2 frequencies of 0s, 1s and 2s in a group S. The task is to find the maximum number… Read More
Given two integers N and X, the task is to generate an array of size N, such that the prefix xor array of X with… Read More
DFA or Deterministic Finite Automata is a finite state machine, in which on every input alphabet a transition is done from one state to another… Read More
Given a 2D array grid[][] of size N * M, consisting of the characters “1”, “0”, and “*”, where “*” denotes an empty space and… Read More
Given a binary string str[] of size N and an integer M. This binary string can be modified by flipping all the 0’s to 1… Read More
Given an array arr[] of size N, the task is to find another array brr[] of size 2*N such that it is non-decreasing and for… Read More