Problem 2572 · Medium

Count the Number of Square-Free Subsets

Each square-free number is a set of primes, so a DP over prime bitmasks counts subsets whose primes never repeat.

Open the interactive visualisation