Skip to content

Tag Archives: Arrays

Given a permutation arr[] of size n  and a positive integer x, the task is to sort the permutation in increasing order by performing the… Read More
Given an array arr[] of integers of size n, the task is to check if we can sort the given array in non-decreasing order(i, e.arr[i]… Read More
Given a string s and an array arr[] representing the weights of each character in the string, the task is to find the heaviest increasing… Read More
Given two integers X and Y, the task is to find the number of different arrays that can be constructed of size largest possible size… Read More
Given an array arr[], the task is to check for each prime number in the array, from its position(indexing from 1) to each non-prime position… Read More
Given an array arr[] of size N, find a new array ans[] where each index i represents the absolute difference between the sum of elements… Read More
Given integers N and X, the task is to construct an array of size N such that exactly X subarrays have positive sums and other… Read More
Given a binary linked list that consists of the 1s and 0s nodes, the task is to find the number of zero-filled subarrays in the… Read More
Given an array of size n, the task is to find the minimum number of operations required in the array such that the product of… Read More
Given a set of N integers with up to 40 elements, the task is to partition the set into two subsets of equal size (or… Read More
Given an array nums of length N which contains two types of numbers, one which has the value zero, the second which is a positive… Read More
Given two integers N (N ≥ 1) and K (K ≥ 1), where N denotes the number of petrol pumps from 1 to N and… Read More
Given a square binary matrix[][] of size n*n. Find the minimum number of operations (changes) needed in a binary matrix to make it the same as… Read More
In this article, we will discuss the grail sort. Grail sort is a sorting algorithm that was introduced by Vladimir Yaroslavskiy. It is an efficient… Read More
Given array A[] of size N, array B[] of size M, and integer X, the task for this problem is to tell whether number X… Read More