Bro In this question I have been trying , to create subarrays from array and find largest element in subarray and check it with the sum of remaining elements excluding the largest element will it can be done with this approach
Greedy means after observing problem statement and given test cases, if you come up with an algorithm or something then, it can be said as greedy algorithm.
Bro In this question I have been trying , to create subarrays from array and find largest element in subarray and check it with the sum of remaining elements excluding the largest element will it can be done with this approach
Actually, this is what I have done. Check the code. Only the approach is optimized.
the topic for the problem is greedy how this solution uses greedy ?
Greedy means after observing problem statement and given test cases, if you come up with an algorithm or something then, it can be said as greedy algorithm.