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 $ ext{lcm}(nums[i], nums[j]) \le$ threshold, where $ ext{lcm}(x, y)$ denotes the least common multiple of
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 $ ext{lcm}(nums[i], nums[j]) \le$ threshold, where $ ext{lcm}(x, y)$ denotes the least common multiple of
Return the total number of connected components in this graph.
Constraints:
nums.length
nums[i]
All elements of nums are unique.
threshold