Longest Subarray With Restricted Pair Sums
Grow a window while no three distinct positions form a pair sum, and when a new element breaks that, drop elements from the left.
Grow a window while no three distinct positions form a pair sum, and when a new element breaks that, drop elements from the left.