Algorithm · Microsoft · Medium
You are given an integer array. Find the largest sum that can be obtained from a contiguous run of its elements and return that sum. Follow-ups Now suppose the array is laid end to end with itself $$K$$ times, producing one longer array. Return the largest contiguous-run sum of that longer array. Interview Notes The first part is a warm-up, and the follow-up is where the real discussion happens. The statement leaves some details open, such as whether an empty run is allowed…