you give integer array num perform follow operation number time numsswap position element numsi numsj gcdnumsi numsj 1 gcdnumsi numsj great common divisor numsi numsjreturn true possible sort num nondecrease order swap method false Example 1input num 7213output trueexplanation we sort 7213 perform follow operation Swap 7 21 gcd721 7 num 2173 Swap 21 3 gcd213 3 num 3721example 2input num 5262output falseexplanation it impossible sort array 5 swap elementExample 3input num 1059315Output trueWe sort 1059315 perform follow operation Swap 10 15 gcd1015 5 num 1559310 Swap 15 3 gcd153 3 num 3591510 Swap 10 15 gcd1015 5 num 3591015 Constraints1 numslength 3 1042 numsi 105