Tutorials
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
19.9K+ articles
Misc
7.8K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Greedy
1.4K+ articles
Searching
1.0K+ articles
prefix-sum
348+ articles
sliding-window
204+ articles
subarray-sum
192+ articles
subarray
658+ posts
Recent Articles
Popular Articles
Count of Subarrays with sum equals k in given Binary Array
Last Updated: 16 May 2025
Given a binary array arr[] and an integer k, the task is to find the count of non-empty subarrays with a sum equal to k.Examples:Input: arr[] = {1, 0, 1, 1, 0, 1}, k = 2Ou...
read more
Picked
DSA
Arrays
subarray
sliding-window
Longest Subarray with sum differences ≤ K
Last Updated: 07 August 2023
Given a sorted array arr[] of size N, the task is to find the length of the longest subarray and print the subarray such that the sum of the differences of the maximum ele...
read more
DSA
Arrays
subarray
Maximizing Subarray sum with constrained traversal and addition time
Last Updated: 17 August 2023
Given two integers N and M representing the Length of arr[] and number of seconds. The task is to maximize the sum of the subarray where it takes 0.5secs to travel in cons...
read more
DSA
Arrays
subarray
sliding-window
Minimum operations to make all Array elements 0 by MEX replacement
Last Updated: 31 October 2023
Given an array of N integers. You can perform an operation that selects a contiguous subarray and replaces all its elements with the MEX (smallest non-negative integer tha...
read more
DSA
Arrays
subarray
Non-Divisible Subarray sum permutation
Last Updated: 22 August 2023
Given a positive integer X, the task is to find a permutation of length X such that all subarray sum of length greater than one is not divisible by subarray length. If no ...
read more
Mathematical
DSA
Arrays
permutation
subarray
Number of subarrays with at-least K size and elements not greater than M
Last Updated: 11 October 2023
Given an array of N elements, K is the minimum size of the sub-array, and M is the limit of every element in the sub-array, the task is to count the number of sub-arrays w...
read more
Mathematical
DSA
Arrays
Analytical Mathematical Puzzles
subarray
Minimum Subarray sum with atleast one repeated value.
Last Updated: 06 December 2023
Given an integer array arr[], the task is to find a minimum subarray sum that has at least one repeated value. If no such subarray is present print -1.Examples:Input: arr[...
read more
DSA
Arrays
prefix-sum
subarray
cpp-unordered_map
Check for Subarray splitting possibility in Prime number
Last Updated: 25 November 2023
Given a positive integer array arr[] of size N and a prime number p, the task is to form an N number of non-empty subarrays by performing a series of steps. In each step, ...
read more
Picked
DSA
Arrays
subarray
Counting Swaps for Equal Sum Subarrays
Last Updated: 30 November 2023
Given an integer N, consider that there is an array of first N natural numbers, the task is to output the number of swaps such that there should be two subarrays of equal ...
read more
Mathematical
Geeks Premier League
DSA
Arrays
subarray
Geeks Premier League 2023
Longest Increasing Subarray of Composite Numbers in Array
Last Updated: 28 November 2023
Given an array of integers arr[], the task is to find the longest increasing subarray of composite numbers in an array.Examples:Input: arr[] = [1, 4, 7, 6, 8, 10, 12]Outpu...
read more
Geeks Premier League
DSA
Arrays
subarray
Geeks Premier League 2023
Sum of Subarrays with Unique elements count
Last Updated: 15 December 2023
Given an array arr[] of length N. The task is to calculate the sum of all subarrays where each subarray value is the number of elements in the subarray that occurs exactly...
read more
Geeks Premier League
DSA
Arrays
subarray
Geeks Premier League 2023
Maximize Array sum by replacing middle elements with min of Subarray corners
Last Updated: 04 December 2023
Given an array A[] of length N. Then your task is to output the maximum sum that can be achieved by using the given operation at any number of times (possibly zero):Select...
read more
Geeks Premier League
DSA
Arrays
subarray
prefix
Geeks Premier League 2023
Subarrays, Subsequences, and Subsets in Array
Last Updated: 15 January 2024
What is a Subarray?A subarray is a contiguous part of array, i.e., Subarray is an array that is inside another array.In general, for an array of size n, there are n*(n+1)/...
read more
DSA
Arrays
subset
subsequence
subarray
Length of Longest Subarray having at Most K Frequency
Last Updated: 30 April 2024
Given an integer array arr[]and an integer K, the task is to find the length of the longest subarray such that the frequency of each element is less than or equal to K.Exa...
read more
Sliding Window 23
DSA
subarray
Subarray, Subsequence and Subsets in Python
Last Updated: 30 April 2025
Algorithms and data manipulation are areas where it is important to grasp the ideas behind subarrays, subsequences as well as subsets. This article introduces the concepts...
read more
Picked
DSA
Arrays
subset
subsequence
subarray
python
1
2
3
4
...
44
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !