# Category Archives: Pattern Searching

Given two strings s1 and s2, check whether s2 is a rotation of s1.Â Examples:Â  Input : ABACD, CDABA Output : True Input : GEEKS, EKSGEâ€¦ Read More
Given a series 0, 4, 18, 48, 100 . . .  and an integer N, the task is to find the N-th term of theâ€¦ Read More
Given an array of integers arr[], find the subsequence with maximum sum whose elements are first decreasing, then increasing, or vice versa, The subsequence canâ€¦ Read More
Juggler Sequence is a series of integer number in which the first term starts with a positive integer number a and the remaining terms areâ€¦ Read More
Given a string str of N characters, the task is to calculate the count of valid unordered pairs of (i, j) such that the stringâ€¦ Read More
Given two positive integers N and K, the task is to construct a permutation of the first N natural numbers such that all possible absoluteâ€¦ Read More
Given three numbers R, G and B as the color code for Red, Green and Blue respectively as in the form of RGB color code.â€¦ Read More
Given an N x M matrix mat[][] where initially we are standing at the cell with index (i, j), the task is to find theâ€¦ Read More
Given an array arr[], the task is to find the length of the longest alternating subarray.  A subarray {x1, x2, .. xn} is an alternatingâ€¦ Read More
Given an integer N, the task is to print the first N terms of the Fibonacci series in reverse order using Recursion. Examples: Input: Nâ€¦ Read More
Given a string str containing lowercase characters, the task is to find the minimum number of operations needed to make all the characters equal. Inâ€¦ Read More
Given an integer N, the task is to print a pattern of fish over 2N+1 rows. Example: Input: N=3Output:        *    â€¦ Read More
Given a string str, the task is to check whether the given string is an HTML Hex Color Code or not. Print Yes if itâ€¦ Read More
Given a number N and an infinite 2D matrix, which is to be filled using the algorithm given below, the task is to find theâ€¦ Read More
Given a binary string S of size N and an integer K, the task is to find the maximum length of consecutive 1s or 0sâ€¦ Read More