Skip to content

Category Archives: Divide and Conquer

In the number guessing game, the user selects a number within a defined range and then the program guesses the number. If the number guessed… Read More
Check if a given number N is a perfect square or not. If yes then return the number of which it is a perfect square,… Read More
Given an array arr[] of N integers, the task is to perform the following two queries: query(start, end): Print the number of Armstrong numbers in… Read More
Given an array arr[] of N integers, the task is to perform the following two queries:  maximum(start, end): Print the maximum Armstrong number of elements… Read More
Given an array arr[] of N integers, the task is to perform the following two queries:  query(start, end): Print the number of perfect square numbers… Read More
Given an array arr[] of N integers and Q queries, each query having two integers L and R, the task is to find the element… Read More
Given an array arr[] of N integers, the task is to perform the following two queries: query(L, R): Print the number of Even Parity numbers… Read More
Given an array arr[] of N integers, the task is to perform the following two queries:  maximum(start, end): Print the maximum Fibonacci number of elements… Read More
Given a binary matrix M where each element of the matrix will be 0 or 1, the task is to find the largest square that… Read More
Given an array of positive integers and a value K, The task is to empty the array in less than or equal to K small… Read More
Given N lines in a plane in the form of a 2D array arr[][] such that each row consists of 2 integers(say m & c)… Read More
Given a binary array arr[] of size N. The task is to answer Q queries which can be of any one type from below: Type 1… Read More
Given an array arr[], the task is to count the number of pairs (arr[i], arr[j]) on the right of every element with any custom comparator. … Read More
Given three integers X, Y and P, the task is to find the minimum window size K such that every window in the range [X,… Read More