The typedArray.subarray() is an inbuilt function in JavaScript which is used to return a part of the typedArray object.
Syntax:
typedarray.subarray(begin, end)
Parame...

Share

Given an unsorted array arr[0..n-1] of size n, find the minimum length subarray arr[s..e] such that sorting this subarray makes the whole array sorted.
Examples:
1) ...

Share

Given an array and an integer k, find the maximum for each and every contiguous subarray of size k.
Examples :
Input :
arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6}
k = 3
Outp...

Share

Given an array A[0 … n-1] containing n positive integers, a subarray A[i … j] is bitonic if there is a k with i <= k <= j such that A[i] <= A[i...

Share

Given an array of distinct integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence.
Examples:
Input: arr...

Share

Given an array of integers, find length of the longest subarray which contains numbers that can be arranged in a continuous sequence.
In the previous post, we have d...

Share

Given an array of integers. find the maximum XOR subarray value in given array. Expected time complexity O(n).
Examples:
Input: arr[] = {1, 2, 3, 4}
Output: 7
The su...

Share

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has the largest sum....

Share

Given an array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task is to print the number of disti...

Share

An array is given, find length of the subarray having maximum sum.
Examples :
Input : a[] = {1, -2, 1, 1, -2, 1}
Output : Length of the subarray is 2
Explanation: Su...

Share