#3493

Properties Graph

specialist · 905 · lc medium +31 · 48.6% accepted · 92 likes · top 35%

Description

Given an n x m integer array properties and integer k, build an undirected graph: connect nodes i and j when the number of distinct integers shared by properties[i] and properties[j] is at least k.

Return the number of connected components in this graph.

Code

1
2
3