Maximum Product Subarray
Code Ganker's post: http://blog.csdn.net/linhuanmars/article/details/39537283?locationNum=1
The local and global variable is very interesting and useful. Key point is that local max should be max(A[i], local[i-1] + A[i]). If A[i] is even larger than previous local max + A[i], then itself should be local max instead.
My answer:
Hello, welcome to Yizhe's Blog. I am Yizhe Liu, graduated from University of Arizona, with Master degree, major in Electrical and Computer Engineering. Actually, I am software guy. In my blog, many posts are about the Leetcode questions. I will post my ideas and implementations, which are accepted by Leetcode. If you have different opinions, please leave comment. I am happy to discuss with you. So lets start rocking them!!!
Tuesday, August 30, 2016
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment