Welcome to the daily solving of our PROBLEM OF THE DAY with Siddharth Hazra We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Binary Search but also build up problem-solving skills.
In this problem, we are given an array arr[] of N elements and a number K., split the given array into K subarrays such that the maximum subarray sum achievable out of K subarrays formed is the minimum possible. Find that possible subarray sum.
Example :
Input:
N = 4, K = 3
arr[] = {1, 2, 3, 4}
Output: 4
Explanation:
Optimal Split is {1, 2}, {3}, {4}.The maximum sum of all subarrays is 4, which is minimum possible for 3 splits.
Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/split-array-largest-sum--141634/1