Minimum possible value of D which when added to or subtracted from K repeatedly obtains every array element
Given an array arr[] of size N and an integer K, the task is to find the maximum possible value of D, such that every array element can be obtained, starting from the initial value of K, by either changing K to K - D or K + D at each step. Examples: Input: arr[ ] = {1, 7, 11}, K = 3Output: 2Explanat