Given two integers X and Y and a binary array arr[] of length N whose first and last element is 1, the task is to… Read More

# Category Archives: Arrays

Given an array, arr[] of size N, the task is to find the maximum possible sum of array elements by alternating the signs of adjacent… Read More

Given two arrays arr[] and jumps[] consisting of N positive integers, the task for each array element arr[i] is to find the minimum number of… Read More

Given an array, arr[] of size N (always even), the task is to construct a new array consisting of N non-zero integers such that the… Read More

Given integers N, L and R, the task is to generate a Bitonic Sequence of length N from the integers in the range [L, R]… Read More

Given two arrays of H[] and B[] consisting of N and M integers respectively, denoting the diameter of holes and balls respectively. M number of… Read More

Given an array arr[] consisting of N integers, and an integer K, the task is to find the maximum number of inversions of the given… Read More

Given an array arr[] consisting of N binary strings, the task is to count the number of strings that does not contain any Arc Intersection.… Read More

Given an array arr[] consisting of N of integers, the task is to find the minimum positive value S that needs to be added such… Read More

Given two sorted arrays A[] and B[] of size N, the task is to check if it is possible to merge two given sorted arrays… Read More

Given two arrays arr1[] and arr2[] of length M and N consisting of digits [0, 9] representing two numbers and an integer K(K ≤ M… Read More

Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array. Examples: Input:… Read More

Given a binary array arr[] of size N and two players, A and B. The task is to minimize the score for player A by… Read More

Given an array arr[] consisting of N strings, the task is to modify the array by replacing the duplicate strings by appending ay number such… Read More