Given an integer array nums, find the length of the longest contiguous subarray such that no element in the subarray is equal to the sum of two other elements at distinct indices within that subarray.
More formally, a subarray is valid if there are no three pairwise distinct indices subarray[i] + subarray[j] = subarray[k].
Return the maximum length of a valid subarray.
Constraints:
nums.length
nums[i]
Given an integer array nums, find the length of the longest contiguous subarray such that no element in the subarray is equal to the sum of two other elements at distinct indices within that subarray.
More formally, a subarray is valid if there are no three pairwise distinct indices subarray[i] + subarray[j] = subarray[k].
Return the maximum length of a valid subarray.
Constraints:
nums.length
nums[i]