Skip to content

Tag Archives: array-rearrange

Given a matrix arr[][] of dimensions M*N, the task is to convert every matrix element to Bitwise XOR of digits present in the element. Examples:… Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to check if the given array can be reduced… Read More
Given an array arr[] consisting of N integers, the task is to replace a minimum number of pairs of adjacent elements by their sum to… 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 (1 ≤ N ≤ 105), the task is to sort digits of each array element in descending order… 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 a square matrix A[][] of  N * N, the task is to sort the boundary elements of a matrix starting from the outermost to the… 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
Given an array A[] consisting of permutation of first N natural numbers, the task is to find the minimum number of operations required to modify… Read More
Given an array arr[] representing a permutation of first N natural numbers, the task is to find the lexicographically smallest permutation of the given array… Read More