Unthinkable interview question

question 3: https://www.geeksforgeeks.org/problems/max-sum-subarray-of-size-k5313/1 - 35 marks