Find element that maximizes LCM of an Array in the range 1 to M
Given an array arr of size N containing numbers in the range [1, M], the task is to find an element, in the range [1, M], which maximises the LCM.Examples: Input: arr[]={3, 4, 2, 7}, M = 8 Output: 5 Explanation: The LCM of existing array (3, 4, 2, 7) = 84 Adding the remaining numbers in 1 to 8 and c