Skip to content

Category Archives: Arrays

Given an array arr[] of size N and a 2D array Q[][], consisting of queries of the following two types: 1 X Val: Update arr[X]… Read More
Given an array arr[] of size N, the task is to maximize the count of distinct array elements by repeatedly inserting the absolute difference between… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum possible difference between the sum of even and odd-indexed… Read More
Given an array arr[] of size N, the task to reverse the array using Stack. Examples: Input: arr[] = { 10, 20, 30, 40, 50… Read More
Given an array arr[] of size N, the task is to empty given array by removing 2i – 1 array elements in each operation (i… Read More
Given an array arr[] of size N, the task is to check if any subarray of size K exists in the array or not, whose… Read More
Given three arrays A[], B[] and C[] of size N and three positive integers X, Y, and Z, the task is to find the maximum… Read More
Given a positive integer N, the task is to find the permutation of first N natural numbers such that the product of Bitwise AND(&) of… Read More
Given a circular array arr[] of size N and an index K, the task is to reverse all elements of the circular array starting from… Read More
Given an array arr[] consisting of N 0s and an array Q[][] with each row of the form (L, R)., the task for each query… Read More
Given an array arr[] consisting of non-negative integers, the task for each array element arr[i] is to print the sum of Bitwise OR of all… Read More
Given an array arr[] of size N, the task is to find the smallest positive integer K such that incrementing or decrementing each array element… Read More
Given a string S of length N consisting of characters “(“ and “)” only, the task is to convert the given string into a balanced… Read More