You are given an integer n representing an array containing the sequence of integers from n in increasing order.
You are also given a conflictingPairs, where each conflictingPairs[i] = [a, b] represents a pair of conflicting numbers.
A contiguous subarray is considered valid if it does not contain both elements of any conflicting pair present in conflictingPairs.
You may remove at most one conflicting pair from conflictingPairs.
Return the maximum possible number of valid subarrays after removing at most one conflicting pair.
Constraints:
n
conflictingPairs.length n
conflictingPairs[i].length
conflictingPairs[i][j] n
conflictingPairs[i][0] conflictingPairs[i][1]
You are given an integer n representing an array containing the sequence of integers from n in increasing order.
You are also given a conflictingPairs, where each conflictingPairs[i] = [a, b] represents a pair of conflicting numbers.
A contiguous subarray is considered valid if it does not contain both elements of any conflicting pair present in conflictingPairs.
You may remove at most one conflicting pair from conflictingPairs.
Return the maximum possible number of valid subarrays after removing at most one conflicting pair.
Constraints:
n
conflictingPairs.length n
conflictingPairs[i].length
conflictingPairs[i][j] n
conflictingPairs[i][0] conflictingPairs[i][1]