Company: UBS_14aug
Difficulty: medium
Decrypt Code Lock Problem Description You are given an array of integers codesequence of length n and an integer maxValue . A locking system requires you to modify any number in the array to any integer val such that val is coprime to all other numbers in the array. Two numbers are co-prime if their greatest common divisor (GCD) is 1. To unlock the repository, you need to select a number from the array that is co-prime with all other numbers in the array. The lock's code is calculated as the maximum possible value of selected number - total modification cost. Your task is to determine the lock code by selecting an optimal number from the array after modifications that is co-prime with all other numbers in the array. Complete the function decryptCodeLock . The function is expected to return an INTEGER . The function accepts the following parameters: INTEGER_ARRAY codesequence : the array presented by the code lock INTEGER maxValue : the maximum possible value for any element in the arra