guys i am not really sure about the syntax of the second line of this function: http://codepad.org/U1QXNiAR i have seen this structure many times but i don't understand it. how the for loops are coming after the "sum" function. how does this work please?
actually i might have worked it out . seems to be the concept of "list comprehensions" which i had not seen before. correct me if i am wrong
yep, it's a list comprehension http://codepad.org/lpMcBnSr what is msum used for? looks like something from one of those project euler problems where you try to find the largest sum from consecutive values in a sequence of numbers
yeah it is used to return the largest consecutive sum in an array of numbers and the bounds of the subarray that make it up. it is actually from the reading material of the course related to dynamic programming.
Join our real-time social learning platform and learn together with your friends!