Dsa
Arrays
Easy
Balanced Array Sums
Given an array of integers, determine if there is a way to split it into two non-empty subarrays such that the sum of the elements in both subarrays is equal. If such a split is possible, print 'YES', otherwise print 'NO'.
Input Format:
- The first line contains an integer n (1 ≤ n ≤ 100), the size of the array.
- The second line contains n space-separated integers, representing the elements of the array.
Output Format:
- Print 'YES' if a balanced split is possible, otherwise print 'NO'.
Example:
Input:
5
1 2 3 3 2
Output:
YES
Key concepts
arrayssumsbalance
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now