you give array integer num perform follow stepsfind adjacent number num noncoprimeif number find stop processotherwise delete number replace LCM Least Common MultipleRepeat process long find adjacent noncoprime numbersReturn final modify array it show replace adjacent noncoprime number arbitrary order lead resultthe test case generate value final array equal 108two value x y noncoprime GCDx y 1 GCDx y Greatest Common Divisor x y Example 1input num 6432762output 1276explanation 6 4 noncoprime LCM6 4 12 now num 1232762 12 3 noncoprime LCM12 3 12 now num 122762 12 2 noncoprime LCM12 2 12 now num 12762 6 2 noncoprime LCM6 2 6 now num 1276there adjacent noncoprime number numsthus final modify array 1276note way obtain resultant arrayExample 2input num 2211333output 2113explanation 3 3 noncoprime LCM3 3 3 now num 221133 3 3 noncoprime LCM3 3 3 now num 22113 2 2 noncoprime LCM2 2 2 now num 2113there adjacent noncoprime number numsthus final modify array 2113note way obtain resultant array Constraints1 numslength 1051 numsi 105the test case generate value final array equal 108