Algorithm · Amazon · Medium
Given an array of integers and a target number, determine the maximum length of any contiguous subarray whose elements add up to the target. Return 0 when no qualifying subarray can be found. Your algorithm must run in O(n) time. Input An integer array nums containing n elements An integer target Output An integer giving the greatest length among subarrays that total the target Example Constraints The array length n is a positive integer -10^9 ≤ nums[i] ≤ 10^9 -10^9 ≤ target…
Checking your access…