My approach was that I print 3 integers “2d 3d 1” as the answer. The gcd of the first 2 elements is d and the minimum is 2*d. So the difference is d.
In all other subarrays the value of min - gcd is 0.
So the sum among all subarrays comes out to be d.
For d == 0, I just printed 1 as the output.
What is wrong with this approach?