# Category Archives: Arrays

Given an array of strings arr[], where each arr[i] represents a single sentence with no leading or trailing spaces. Return the count of the maximum… Read More
Given an array, arr[] of size N, the task is to find the sum of the at most K non-overlapping contiguous subarray within an arr[]… Read More
Given four integers A, B, C, and D, the task is to find the maximum sum of the given numbers by using the below operations… Read More
Given an array, arr[] of integers and an integer K, the task is to print true if there are K consecutive even numbers present else… Read More
Given an array arr[] of integers, the task is to find the length of the second longest increasing subsequence (LIS). Examples: Input: arr[] = {1,… Read More
Given an array of strings, the task is to print “Yes” if it contains a string that is a prefix of another string otherwise, print… Read More
Given an array X[]. By using the given operation, you need to return the number of elements having the same initial value except 1 and… Read More
Given N poles, each pole consists of hi number of vertices. Vertices on each pole are numbered from 1 to hi, the task is to… Read More
Given a binary string S of length N along with Y[] of size K. Then you have to perform K number of queries for each… Read More
Given an array arr[]of size N. We have to pair the integers such that each integer should be in exactly one pair and each sum… 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 an array arr[] of length N, the task is to check if we can make all elements of the array equal by taking two… Read More
Given an array X[] of odd length N(N ≥ 3) and an integer K. Arrange elements of X[] in such a way that the merged… Read More
Given an array arr[] of length n which contains positive integers (0 ≤ arr[i] ≤ 109), the task is to count the number of elements… Read More