Maximize It!

  • + 1 comment

    Originally I looked at the max value in each list, used abs() on it in case it is negative and then squared it and found the sum of these max for all the lists. It only passed a few tests. Then I used product() as suggested here. But how is product any different. It map(sum, itertools.product(*ls)) will add up all the elements squared which means the biggest numbers in the lists will be added and hence still have the same effect. Anyone could please explain or perhaps show me a usecase where my original algorithm would fail? Thanks a lost