Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Square-Free Subsets

med
30 min
Try to solve the Count the Number of Square-Free Subsets problem.

Statement

Given an integer array nums, determine the number of non empty square free subsets of nums. Since the result can be very large, return it modulo 109+710^9 + 7.

A subset is considered square free if the product of its elements is a square free integer.

A square free integer is an integer that is not divisible by any square number greater than 11.

A subset of an array is a selection of elements obtained by deleting zero or more elements without changing the order of the remaining elements. Two subsets are considered distinct if they are chosen from different sets of indices.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Square-Free Subsets

med
30 min
Try to solve the Count the Number of Square-Free Subsets problem.

Statement

Given an integer array nums, determine the number of non empty square free subsets of nums. Since the result can be very large, return it modulo 109+710^9 + 7.

A subset is considered square free if the product of its elements is a square free integer.

A square free integer is an integer that is not divisible by any square number greater than 11.

A subset of an array is a selection of elements obtained by deleting zero or more elements without changing the order of the remaining elements. Two subsets are considered distinct if they are chosen from different sets of indices.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤30\leq 30