Maximum distance between two elements whose absolute difference is K
Given an array arr[] and a number K, the task to find the maximum distance between two elements whose absolute difference is K. If it… Read More »
Given an array arr[] and a number K, the task to find the maximum distance between two elements whose absolute difference is K. If it… Read More »
Given an array arr[] consisting of non-negative integers, the task is to find the number of ways to split the array into three non-empty contiguous… Read More »
Given an array arr[], the task is to check if it is possible to rearrange the array in such a way that every even index(1-based… Read More »
Given an array arr[] of N positive integers and an integer K., The task is to create a set of prime numbers such that the… Read More »
Given an array a[] consisting of N integers and an integer K, the task is to find the minimum cost to reduce the given array… Read More »
Given an array arr[] consisting of N non-negative integers, the task is to find the minimum number of subarrays that needs to be reduced by… Read More »
Given a 2D grid arr[][] with different characters, the task is to detect whether it contains a cycle or not. A sequence of characters or… Read More »
Given an array arr[] of N integers, the task is to find if the array can be divided into 2 sub-array such that the first… Read More »
Given an array arr[] of N elements. The task is to count the total number of indices (i, j) such that arr[i] = arr[j] and… Read More »
Given an array arr[] consisting of N elements, the task is to check if the given array can be sorted by picking only corner elements… Read More »
Given an array of strings arr[], consisting of N strings each representing dot separated numbers in the form of software versions. Input: arr[] = {“1.1.2”,… Read More »
Given a matrix mat[][] consisting of N pairs of the form {x, y} each denoting coordinates of N points, the task is to find the… Read More »
Given an array arr[] of length N, the task is to find the median of the differences of all pairs of the array elements. Example:… Read More »
Given an array arr[] consisting of N integers, rearrange the array such that it satisfies the following conditions: arr[0] must be 1. Difference between adjacent… Read More »
Given an array arr[] consisting of N integers, denoting N points lying on the X-axis, the task is to find the point which has the… Read More »