Find K that requires minimum increments or decrements of array elements to obtain a sequence of increasing powers of K
Given an array consisting of N integers, the task is to find the integer K which requires the minimum number of moves to convert the given array to a sequence of powers of K, i.e. {K0, K1, K2, ......., KN - 1}. In each move, increase or decrease an array element by one. Examples: Input: arr[] = {1,