Problem 2436 · Medium

Minimum Split Into Subarrays With GCD Greater Than One

Grow each subarray while its running gcd stays above one; cut a new subarray the moment the gcd falls to one.

Open the interactive visualisation