Skip to content

Category Archives: Algorithms

Given two numbers N and K, and a pair A and B, the task is to multiply N by A or B as many times… Read More
Given an array stream of n integers in the form of a stream, the task is to find the minimum number of operations that are… Read More
A greedy algorithm is an algorithmic paradigm that follows the problem-solving heuristic of making the locally optimal choice at each stage with the hope of… Read More
Given a positive integer arr[] of length L (2 ≤ L ≤ 2000) containing elements from 1 to L in unsorted order and an integer… Read More
Given an array arr[] of size N, the task is to find the maximum number of sub-arrays such that the GCD(Greatest Common Factor) of all… Read More
Text files can be compressed to make them smaller and faster to send, and unzipping files on devices has a low overhead. The process of… Read More
Given an integer array Arr[] of length N and an array Queries[] of length Q where Queries[i] = [valuei, indexi]. For each query i, update… Read More
Given an integer N, the task is to find the total number of distinct tuples(P, Q, R, S) formed by four integers with 1 ≤… Read More
What are sorting networks in parallel computing? Sorting networks are comparison networks that always sort their inputs. They are also known as comparison networks. Comparison… Read More
Given a number N, the task is to find a permutation A[] of first N integers such that the absolute difference of adjacent elements is… Read More
Given a binary string S of even size that contains only 0s and 1s, the task is to find the minimum flips (that is 0… Read More
Given an array arr[] of size N, the task is to minimize the number of distinct elements in the array after performing the following operation… Read More
A queue is a linear data structure in which insertion is done from one end called the rear end and deletion is done from another… Read More
Given an array arr[] of length N, denoting the cost of N items and the cashback upon buying that item, the task is to find… Read More
Given an N×N Matrix Mat[][] of N rows and N columns. There is exactly one Queen on the chessboard and the cell that is under… Read More

Start Your Coding Journey Now!