You are given an array of unique positive integers nums and a positive integer threshold.
Consider an undirected graph where each element of nums represents a node. There is an edge between two distinct nodes nums[i] and nums[j] if and only if threshold, where
Return the total number of connected components in this graph.
Constraints:
nums.length
nums[i]
All elements of nums are unique.
threshold
You are given an array of unique positive integers nums and a positive integer threshold.
Consider an undirected graph where each element of nums represents a node. There is an edge between two distinct nodes nums[i] and nums[j] if and only if threshold, where
Return the total number of connected components in this graph.
Constraints:
nums.length
nums[i]
All elements of nums are unique.
threshold