Tap here to switch tabs
Problem
Submissions

Problem: Minimum Split Into Subarrays With GCD Greater Than One

med
30 min
Try to solve the Minimum Split Into Subarrays With GCD Greater Than One problem.

Statement

Given an array of integers nums, split nums into the minimum number of contiguous subarrays such that the greatest common divisor (GCD) of all elements in each subarray is strictly greater than 11.

Return the minimum number of subarrays required to achieve this split.

Note: A subarray is a contiguous non empty sequence of elements within an array. The greatest common divisor ($ ext{GCD}$) of a sequence of integers is the largest positive integer that evenly divides each integer in the sequence.

Constraints:

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

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Split Into Subarrays With GCD Greater Than One

med
30 min
Try to solve the Minimum Split Into Subarrays With GCD Greater Than One problem.

Statement

Given an array of integers nums, split nums into the minimum number of contiguous subarrays such that the greatest common divisor (GCD) of all elements in each subarray is strictly greater than 11.

Return the minimum number of subarrays required to achieve this split.

Note: A subarray is a contiguous non empty sequence of elements within an array. The greatest common divisor ($ ext{GCD}$) of a sequence of integers is the largest positive integer that evenly divides each integer in the sequence.

Constraints:

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

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