Skip to content

Category Archives: Pattern Searching

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
Given an array arr[] of size N and an integer K, the task is to find the maximum and minimum number of elements whose sum… Read More
Given three strings S, S1, and S2 consisting of N, M, and K characters respectively, the task is to modify the string S by replacing… Read More
Given a positive integer K, the task is to find Kth smallest palindromic number odd length. Examples: Input: K = 5Output: 5Explanation:The palindromic numbers of… Read More
Given a string S of size N and containing digits in the range [0-9], the task is to print the count of all the unique… Read More
Given a positive integer N and a digit K, the task is to find the minimum count of numbers ending with digit K such that… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum number of operations required to make the array non-decreasing by… Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to find the last element present in the array… Read More
Given an array arr[] consisting of N positive integers, the task is to check if it is possible to color the N objects such that… Read More
Given three integers L, R, and K, the task is to find the minimum Bitwise XOR of at most K integers between [L, R]. Examples:… Read More