Given an array arr[] consisting of N integers, the task is to find the last remaining array element after removing every second element, starting from… Read More

# Category Archives: Pattern Searching

Given a positive integer N, the task is to find the Nth term of the Ruler Function Series. The Ruler Function Series is a series,… Read More

Given three integers A, B, and C representing the coefficients of a quadratic equation Ax2 + Bx + C = 0, the task is to… Read More

Given a positive integer N, the task is to find the single digit obtained after recursively adding the digits of 2N until a single digit… Read More

Given an array arr[] consisting of N positive integers, the task is to make all array elements equal by repeatedly subtracting 1 from any number… Read More

Given a matrix mat[][] of dimension N * M, the task is to count the minimum number of decrements of distinct array elements required such… Read More

Given two strings text and pattern of length M and N respectively, the task is to check if the pattern matches the text or not.… Read More

Given two positive integers N and K, the task is to check if the given integer N can be expressed as the product of K… Read More

Given a string S, the task is to find the minimum removal of characters required such that the string S consists only of two alternating… Read More

Given two integers L and R, the task is to find the number of unique triplets whose values lie in the range [L, R], such… Read More

Given two binary strings A and B of length N, the task is to convert the string A to B by repeatedly flipping a prefix… Read More

Given an integer N and a binary string consisting of 4*N number of 0s initially, the task is to flip the characters such that any… Read More

Given two positive integers N and X, the task is to count the occurrences of the given integer X in an N-length square matrix generated… Read More