Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2572. Count the Number of Square-Free Subsets
Count the number of non-empty subsets whose product is square-free (no prime squared divides it) modulo 1e9+7. With nums[i] ≤ 30 and n ≤ 1000, the core challenge is avoiding repeated prime factors across subset elements—typically solved by counting frequencies and using DP over prime-factor bitmasks (treating 1s separately).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.