Given an array of n elements and a number k, which denotes the number of operations you can perform on the array. Find the minimum of maximum of array elements you can get by dividing the array elements using k operations.
Ex 1 - arr = [9] k = 2 , ans = 3
explanation : operation 1 => divide 9 into [3,6]
operation 2 => divide 6 into [3,3]
final arr => [3, 3, 3] max = 3
if k = 1, ans = 5
Ex 2- arr = [2, 4, 8 ,2] k = 4 , ans = 2
explanation : operation 1 => divide 8 into [4,4]
operation 2 => divide 4 into [2,2]
operation 3 => divide 4 into [2,2]
operation 4 => divide 4 into [2,2]
final arr => [2, 2, 2, 2 ,2, ,2 ,2 ,2] max = 2
i proposed a backtracking solution. is there a better way to solve this problem?