Let's see a popular Leetcode question number 53. In this program we have to find the maximum subarray sum.
What does this mean?
Given an integer array nums, find the maximum contiguous subarray (containing at least one number) which has the largest sum and return the sum.
For eg. [1, -2, 3, 4] is the array then the answer will be [3,4] and the output will be 7.
Now as we always do in all our lectures. Let's understand a naive approach.
We already know how to find the subarrays of a given array.
Hence we can find the sum of all subarrays and can return the maximum sum.
This approach will surely work but it's not efficient.
Let's see in this lecture how we can find a more efficient approach to solving this program.
For more information, fill out this form: forms.gle/8eiUmM92Fx563Aen9
or call us at 8884881203
Facebook: / thetapacademy
Instagram: / tapacademy_online
Linkedin: / 73820805
Website: www.thetapacademy.com
#java #array #programming #programmer #coding #dsa #placement #job #itjobs
Негізгі бет Find The Maximum Subarray Sum ( LeetCode #53 ) | FREE DSA Course in JAVA | Lecture 75
Пікірлер: 76