Tap here to switch tabs
Problem
Submissions

Problem: Check if it is Possible to Split Array

Check if it is Possible to Split Array asks whether an integer array can be split into single-element arrays, with every split producing parts of length one or sum at least m.

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

Check if it is Possible to Split Array asks whether an integer array can be split into single-element arrays, with every split producing parts of length one or sum at least m.

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