Dsa
Two Pointers
Hard
Balanced Subarray Split
Given an array of integers, you need to determine if it's possible to split the array into two contiguous subarrays such that the sum of the elements in both subarrays is equal. You should print 'YES' if it is possible to split them, otherwise print 'NO'. Input is a single line of space-separated integers. Example input: '1 2 1 2'. Example output: 'YES'.
Key concepts
two_pointerssubarraysprefix_sums
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