You are given two integer arrays prices and strategy of the same length, along with an even integer k.
The initial total profit is defined as the sum of strategy[i] * prices[i] across all indices i.
You are allowed to perform at most one operation: select a contiguous subarray of strategy of length k, and modify its elements such that the first
Return the maximum possible total profit that can be achieved.
Constraints:
prices.length strategy.length
prices[i]
strategy[i]
k prices.length
k is even
You are given two integer arrays prices and strategy of the same length, along with an even integer k.
The initial total profit is defined as the sum of strategy[i] * prices[i] across all indices i.
You are allowed to perform at most one operation: select a contiguous subarray of strategy of length k, and modify its elements such that the first
Return the maximum possible total profit that can be achieved.
Constraints:
prices.length strategy.length
prices[i]
strategy[i]
k prices.length
k is even