# Category Archives: Arrays (adsbygoogle = window.adsbygoogle || []).push({});

## Find the longest Fibonacci-like subarray of the given array

Given an array of N elements, the task is to find the longest subarray which is Fibonacci-like. A Fibonacci-like sub-array is defined as an array… Read More »

## Queries for number of distinct integers in Suffix

Given an array of N elements and Q queries, where each query contains an integer K. For each query, the task is to find the… Read More »

## Minimize the sum of the squares of the sum of elements of each group the array is divided into

Given an array consisting of even number of elements, the task is to divide the array into M group of elements (every group must contain… Read More »

## Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )

Giving k sorted arrays, each of size N, the task is to merge them into a single sorted array. Examples: Input : arr[][] = {{5,… Read More »

## Maximum length subsequence such that adjacent elements in the subsequence have a common factor

Given an array arr[], the task is to find the maximum length of a subsequence such that the adjacent elements in the subsequence have a… Read More »

## Count of pairs (x, y) in an array such that x < y

Given an array of N distinct integers, the task is to find the number of pairs (x, y) such that x < y. Example: Input:… Read More »

## Minimize the sum of squares of sum of N/2 paired formed by N numbers

Given N numbers(N is an even number). Divide the N numbers into N/2 pairs in such a way that the sum of squares of the… Read More »

## Length of the longest alternating subarray

Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or… Read More »

## Array Manipulation and Sum

Given an array arr[] of N integers and an integer S. The task is to find an element K in the array such that if… Read More »

## Shortest path to traverse all the elements of a circular array in increasing order

There are N distinct integers arranged on a circle. The distance between any two adjacent numbers is 1. The task is to travel on this… Read More »

## Minimum elements to be removed such that sum of adjacent elements is always odd

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

## Find the number of points that have atleast 1 point above, below, left or right of it

Given N points in 2 dimensional plane. A point is said to be above another point if the X coordinates of both points are same… Read More »

## Modify a binary array to Bitwise AND of all elements as 1

Given an array a[] consisting only 0 and 1. The task is to check if it is possible to transform the array such that the… Read More »

## Minimum number of operations on an array to make all elements 0

Given an array arr[] of N integers and an integer cost, the task is to calculate the cost of making all the elements of the… Read More »

## Count of unique pairs (arr[i], arr[j]) such that i < j

Given an array arr[], the task is to print the count of unique pairs (arr[i], arr[j]) such that i < j. Examples: Input: arr[] =… Read More »