# Category Archives: Pattern Searching

Given a string S representing a Morse Code, the task is to check is the code is valid or not. A Morse code is valid… Read More
Given an array arr[] containing N email addresses with different domains, the task is to find the unique domains and their frequencies from the list… Read More
Given two arrays, arr1[] of length N1 and arr2[] of length N2, consisting of numbers from 1 to 9 and arr1[] has some missing entries… Read More
Given an integer N and the task is to generate a permutation of the numbers in range [1, N] such that:  The GCD of all… Read More
Given an array arr[] of N integers and an integer K, the task is to do the below operations with this array K times. Operations… Read More
Given two strings, text and pattern, of size N and M (N > M)respectively, the task is to print all occurrences of pattern in text. … Read More
Given an integer N, the task is to construct and print an Array, such that: The size of array is N The elements in array… Read More
Given an array arr[] of size N, and an integer K, the task is to maximize the first element of the array in K operations… Read More
Given an Array input[] consisting only of 1s initially and an array target[] of size N, the task is to check if the array input[]… Read More
Given an integer N, the task is to construct the longest possible array A[], such that the following conditions hold: A[0] = N. No two… Read More
Given an array arr[] of N integers, the task is to sort the array by replacing any element at index i (arr[i]) with arr[j] –… Read More
Given integers N and K, the task is to construct an array arr[] of size N using numbers in the range [1, N] such that… Read More
Given the root of a binary tree in which all nodes has values either 0 or 1, the task is to check if the level-wise… Read More
Consider an integer sequence S, which is initially empty (i.e. S = {}). Also given are Q queries, each of which is one of the… Read More
Given an array arr[] of size N (multiple of 8) where the values in the array will be in the range [a, (a+8*N) -1] (a… Read More