Tap here to switch tabs
Problem
Submissions

Problem: Number of Great Partitions

Try to solve the Number of Great Partitions problem.

Statement

You are given an integer array nums and an integer k.

A partition of the array into two groups is considered a great partition if:

  • Every element in nums belongs to exactly one of the two groups.

  • The sum of elements in each group is greater than or equal to k.

Return the number of distinct great partitions. Since the answer may be large, return it modulo 109+710^9 + 7.

Two partitions are considered distinct if there is at least one element of nums that is assigned to different groups in the two partitions.

Constraints:

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

  • 1≤1 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Great Partitions

Try to solve the Number of Great Partitions problem.

Statement

You are given an integer array nums and an integer k.

A partition of the array into two groups is considered a great partition if:

  • Every element in nums belongs to exactly one of the two groups.

  • The sum of elements in each group is greater than or equal to k.

Return the number of distinct great partitions. Since the answer may be large, return it modulo 109+710^9 + 7.

Two partitions are considered distinct if there is at least one element of nums that is assigned to different groups in the two partitions.

Constraints:

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

  • 1≤1 \leq nums[i] ≤109\leq 10^9