Available question text
Count the number of subsets of a multiset of integers such that no two chosen elements differ by k. The challenge is to handle duplicate values and large counts efficiently by grouping values and computing independent-set counts over the graph of values connected by edges for difference k (with the result usually asked modulo 10^9+7).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2638. Count the Number of K-Free Subsets
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source