← Salesforce questions

Find all subarrays with zero sum

Filed under Salesforce

Given an array of positive and negative integers, find all subarrays (contiguous ranges) whose elements sum to zero. Return their (start, end) index pairs.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Salesforce questions

Collected from public candidate posts and coding forums. Updated Nov 2026.