Tap here to switch tabs
Problem
Submissions

Problem: Check if it is Possible to Split Array

med
30 min
Try to solve the Check if it is Possible to Split Array problem.

Statement

You are given an integer array nums of length n and an integer m.

You need to determine if it is possible to split nums into n arrays of size 11 through a sequence of split operations.

In each operation, you can choose any existing subarray of length at least 22 and split it into two non empty subarrays. A split is valid if each of the two resulting subarrays satisfies at least one of the following conditions:

  • The length of the subarray is 11.

  • The sum of the elements of the subarray is greater than or equal to m.

Return true if nums can be split into n arrays of size 11, or false otherwise.

Constraints:

  • 1≤n==1 \leq n == nums.length ≤100\leq 100

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

  • 1≤1 \leq m ≤200\leq 200

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if it is Possible to Split Array

med
30 min
Try to solve the Check if it is Possible to Split Array problem.

Statement

You are given an integer array nums of length n and an integer m.

You need to determine if it is possible to split nums into n arrays of size 11 through a sequence of split operations.

In each operation, you can choose any existing subarray of length at least 22 and split it into two non empty subarrays. A split is valid if each of the two resulting subarrays satisfies at least one of the following conditions:

  • The length of the subarray is 11.

  • The sum of the elements of the subarray is greater than or equal to m.

Return true if nums can be split into n arrays of size 11, or false otherwise.

Constraints:

  • 1≤n==1 \leq n == nums.length ≤100\leq 100

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

  • 1≤1 \leq m ≤200\leq 200