Skip to content

Category Archives: Algorithms

Given an array arr[] and two integers L and R. The task is to find the sum of the product of all the pairs (i,… Read More
Given two arrays X[] and Y[] of size N, the task is to find the longest subarray in X[] containing only unique values such that… Read More
Given an array arr[] of size N and an integer K. The task is to find the Kth largest element from the right of every… Read More
Given an array arr[]. The task is to divide arr[] into the maximum number of partitions, such that, those partitions if sorted individually make the… Read More
Given two positive integers A and B. The task is to find the minimum number of operations required to convert number A into B. In… Read More
Given an array a[] of positive integers. Subtract any positive integer from any number of elements of the array such that there exists every possible… Read More
Given an integer N denoting the number of elements, the task is to find the number of ways to divide these elements equally into groups… Read More
Given a doubly-linked list containing n nodes. The problem is to reverse every group of k nodes in the list. Examples:  Input: List: 10<->8<->4<->2, K=2Output:… Read More
Given an array arr[] of size N. The task is to find the number of sequences in which any one of the following conditions is… Read More
Given binary string str, the task is to choose any index and change into 0 or 1, and do this in minimum steps such that… Read More
Given 4 integers A, B, Z1, and Z2. The task is to compare A*10Z1 and B*10Z2.  Examples: Input: A = 19, Z1 = 2, B… Read More
Given an array arr[] of size N and integer K, the task is to maximize the sum of the array by performing the following operations… Read More
Given a directed weighted graph represented by a 2-D array graph[][] of size n and 3 integers src, dst, and k representing the source point,… Read More
Given an integer array arr[] of size N and a positive integer K, the task is to count all the pairs in the array with… Read More
Given an array nums[] and a value k. The task is to find the maximum elements that can be made equal with at most k… Read More

Start Your Coding Journey Now!