Help me to solve length of shortest segment such that gcd is 1

Given an array of n integers. Let’s say that a segment of this array a[l…r] (1≤l≤r≤n) is good if the GCD of all numbers on this segment is 1. Your task is to find the shortest good segment.
– Is this problem can be solved in sliding window technique
– if does kindly provide solution