Skip to content

Category Archives: Arrays

Given an array arr[] consisting of N positive integers, the task is to find the maximum sum of Bitwise AND of same-indexed elements of permutation… Read More
Given an array arr[] consisting of N integers and a positive integer M, the task is to find the number of array elements that occur… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum number of swaps required to make the parity (i.e., even… Read More
Given an array arr[] of size N, the task is to count the number of subarrays from the given array whose Bitwise XOR  is even.… Read More
Given an array arr[] of size N (1 ≤ N ≤ 105), the task is to sort digits of each array element in descending order… Read More
Given an array arr[] of size N and a positive integer K, the task is to find the sum of all array elements which are… Read More
Given an array arr[] consisting of N integers, the task is to sort the given array by using Bubble Sort without using loops. Examples: Input:… Read More
Given two arrays A[] and B[], both of size N, the task is to generate a sequence of length N comprising elements from the two… Read More
Given an array nums[] and an integer X, the task is to reduce X to 0 by removing either the leftmost or the rightmost array… Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to count the number of subarrays having exactly K… Read More
Given an array arr[] of size N, and an integer K, the task is to count the number of pairs from the given array whose… Read More
Given a positive integer K and two arrays A[] and B[] consisting of M and N positive integers from the range [1, K] respectively, the… Read More
Given an array arr[] of N positive integers and an integer K, the task is to find the minimum number of insertions of any positive… Read More