Maintain a sliding window of two sub arrays with length L and M and slide through. For each slide check two cases:
L first, or M first. Use prefix sum to speed up calculation of sum of a given sub array.
use std::cmp; |
Maintain a sliding window of two sub arrays with length L and M and slide through. For each slide check two cases:
L first, or M first. Use prefix sum to speed up calculation of sum of a given sub array.
use std::cmp; |