โ† Infosys questions

Split the array into good sub-arrays based on GCD

Filed under Infosys

Given an array of n integers, find the minimum number of split sub-arrays such that every sub-array val[i..j] satisfies gcd(val[i], val[j]) > 1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Infosys questions

Collected from public candidate posts and coding forums. Updated Nov 2026.