Input: arr[] = [5, 1, 5, 4], K = 8
Output: 3
Explanation:
We can pick {1, 4}, {5}, {5} in 3 steps:
Other possible arrangement can be {1, 5}, {4}, {5} in three steps.
So, the minimum number of steps are required is 3
Input: [1, 2, 1, 1, 3], n = 9
Output: 3
Explanation:
We can pick {1, 1}, {2, 3} and {1} in three steps.
Other possible choices {1, 3}, {1, 2}, {1} or {1, 1}, {1, 3}, {2}
So, the minimum number of steps are required is 3