Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
DSA
22.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Greedy
2k+ articles
Searching
1.7k+ articles
Dynamic Programming
1.5k+ articles
Hash
1.2k+ articles
subarray
640+ articles
prefix-sum
330+ articles
sliding-window
190+ articles
subarray-sum
180+ posts
Popular Articles
Recent Articles
Print subarray with maximum sum
Last Updated: 11 September 2024
Given an array arr[], the task is to print the subarray having maximum sum.Examples:Input:arr[] = {2, 3, -8, 7, -1, 2, 3}Output:11Explanatio
...read more
Arrays
Dynamic Programming
subarray
Arrays
Algorithms-Dynamic Programming
Kadane
subarray-sum
DSA
Count Subarrays having Sum K
Last Updated: 26 December 2024
Given an unsorted array of integers, the task is to find the number of subarrays having a sum exactly equal to a given number k.Examples:Inp
...read more
Arrays
Hash
subarray
cpp-unordered_map
subarray-sum
DSA
Longest Subarray With Sum Divisible By K
Last Updated: 22 April 2025
Given an arr[] containing n integers and a positive integer k, he problem is to find the longest subarray's length with the sum of the eleme
...read more
Arrays
Snapdeal
Hash
subarray
prefix-sum
subarray-sum
DSA
Similar Topics
DSA
22.5k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Greedy
2k+ articles
Searching
1.7k+ articles
Dynamic Programming
1.5k+ articles
Hash
1.2k+ articles
subarray
640+ articles
prefix-sum
330+ articles
sliding-window
190+ articles
K-th Largest Sum Contiguous Subarray
Last Updated: 08 May 2025
Given an arrayarr[]of sizen, the task is to find the kth largest sum of contiguous subarray within the array of numbers that has both negati
...read more
Arrays
Order-Statistics
Heap
subarray
subarray-sum
DSA
Smallest sum contiguous subarray
Last Updated: 07 March 2025
Given an array containing n integers. The problem is to find the sum of the elements of the contiguous subarray having the smallest(minimum)
...read more
Arrays
Dynamic Programming
subarray
subarray-sum
DSA
Split an array into two equal Sum subarrays
Last Updated: 11 July 2022
Given an array of integers greater than zero, find if it is possible to split it in two subarrays (without reordering the elements), such th
...read more
Arrays
subarray
subarray-sum
DSA
Find maximum (or minimum) sum of a subarray of size k
Last Updated: 05 August 2024
Given an array of integers and a number k, find the maximum sum of a subarray of size k.Examples:Input : arr[] = {100, 200, 300, 400}, k = 2
...read more
Arrays
subarray
sliding-window
subarray-sum
DSA
Sum of all Subarrays
Last Updated: 26 November 2024
Given an integer array arr[], find the sum of all sub-arrays of the given array.Examples:Input: arr[] = [1, 2, 3]Output: 20Explanation: {1}
...read more
Arrays
Mathematical
Modular Arithmetic
subarray
subarray-sum
DSA
Longest Subarray with 0 Sum
Last Updated: 02 November 2024
Given an array arr[] of size n, the task is to find the length of the longest subarray with sum equal to 0.Examples:Input: arr[] = {15, -2,
...read more
Arrays
Amazon
MakeMyTrip
Hash
subarray
prefix-sum
subarray-sum
DSA
Smallest subarray with sum greater than a given value
Last Updated: 26 December 2024
Given an array arr[] of integers and a number x, the task is to find the smallest subarray with a sum strictly greater than x.Examples:Input
...read more
Arrays
Amazon
Facebook
Goldman Sachs
Accolite
subarray
sliding-window
subarray-sum
DSA
Subarray with 0 sum
Last Updated: 20 July 2024
Given an array of positive and negative numbers, the task is to find if there is a subarray (of size at least one) with 0 sum.Examples:Input
...read more
Paytm
MakeMyTrip
Hash
STL
subarray
Hash
prefix-sum
cpp-unordered_set
subarray-sum
DSA
Maximum Subarray Sum using Divide and Conquer algorithm
Last Updated: 24 December 2024
Given an arrayarr[],the task is to find the subarray that has the maximum sum and return its sum.Examples:Input: arr[] = [2, 3, -8, 7, -1, 2
...read more
Arrays
Amazon
Dynamic Programming
Divide and Conquer
subarray
Junglee Games
subarray-sum
DSA
Maximum Circular Subarray Sum
Last Updated: 14 October 2024
Given a circular array arr[] of size n, find the maximum possible sum of a non-empty subarray.Examples:Input: arr[] = {8, -8, 9, -9, 10, -11
...read more
Arrays
subarray
Arrays
circular-array
subarray-sum
DSA
Subarray with Given Sum
Last Updated: 30 December 2024
Given a 1-based indexing array arr[] of non-negative integers and an integer sum. You mainly need to return the left and right indexes(1-bas
...read more
Arrays
Amazon
Google
Morgan Stanley
Facebook
Zoho
Visa
FactSet
subarray
sliding-window
subarray-sum
DSA
Maximum Subarray Sum - Kadane's Algorithm
Last Updated: 28 February 2025
Given an array arr[], the task is to find the subarray that has the maximum sum and return its sum.Examples:Input: arr[] = {2, 3, -8, 7, -1,
...read more
Arrays
Microsoft
Amazon
Morgan Stanley
Oracle
Flipkart
Samsung
D-E-Shaw
Walmart
VMWare
Snapdeal
Accolite
Payu
Zoho
Hike
MakeMyTrip
Visa
Housing.com
Ola Cabs
24*7 Innovation Labs
MetLife
FactSet
Teradata
Dynamic Programming
OYO
Amazon-Question
Visa-Question
subarray
subarray-sum
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
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 !