Array
2654. Minimum Number of Operations to Make All Array Elements Equal to 1
Given an array of positive integers nums. One operation picks an adjacent pair and replaces one of the elements with their gcd. Find the minimum operations to make all elements equal to 1; −1 if…
Loading…