Minimum Subarrays in a Valid Split
Prefix DP: the last piece must have endpoints with gcd above one; try each start point and keep the fewest pieces.
Prefix DP: the last piece must have endpoints with gcd above one; try each start point and keep the fewest pieces.