class Questions::Issue20260223


Question

Given an array of integers, find the contiguous subarray that has the largest sum and return that sum. A subarray must contain at least one element. If all elements are negative, return the largest (least negative) value.

If you need a hint, look up Kadaneโ€™s Algorithm!