Problem

  • Given an unsorted array of non-negative integers A and a number sum
  • Find a continuous subarray that adds up to sum

Approach 1: Brute Force


Approach 2: Sliding Window