Skip to content

Category Archives: Arrays

Given an array arr[], the task is to check if the array can be sorted using the given operation any number of times. In one… Read More
Given an array arr[] of length N of 0’s and 1’s, the task is to find the total number of subarrays of 0’s. Examples: Input:… Read More
Given an array dir_list[] that represents direction where the valid directions are “UP”, “Left”, “Right” and “Down”. Your goal is to reduce the instructions by… Read More
Two players X and Y are playing a game in which there are pots of gold arranged in a line, each containing some gold coins.… Read More
There is a string of size N containing only ‘A’ and ‘O’. ‘A’ stands for Apple, and ‘O’ stands for Orange. We have M number… Read More
The Bell triangle or Aitken’s array or the Pierce Triangle is the number triangle obtained by beginning the first row with the number one, then… Read More
Rotations in the array is defined as the process of rearranging the elements in an array by shifting each element to a new position. This… Read More
Matrix Rotation is defined as rotating the elements of the array around its center in a clockwise or counterclockwise direction, or rotating the elements by… Read More
Given an array arr[] of integers and an integer K, the task is to find the minimum number of operations required to make every Kth… Read More
Given an array arr[] of N integers, the task is to find the length of the longest subarray where the sum of the elements in… Read More
Given an array arr[] of positive integers, the task is to find the count of all triplets such that XOR of two equals the third… Read More
Given a 0-based n x n integer matrix where grid[x][y] represents the height of the blocks in row x and column y. You can increase… Read More
Given an array A[] of size N. You have to take another array B of size N and fill it with all 0’s. Find the… Read More
Given an array, arr[] of size N, and an integer K, the task is to check if it is possible to form a permutation from… Read More
Invariants and Monovariants are the two properties of mathematics and computer science that describe objects and algorithms. Invariants and mono variants are important mathematical concepts… Read More

Start Your Coding Journey Now!