Intuition : We can get max product by either multiplying two large positive numbers or by multiplying two small negative numbers -> so we need to store the maximum as well as minimum ...
# Method 1:- Brute Force :- TC O(n^3) and SC O(1) # maxLength = 0 # for startIndex in range(len(nums)): # for endIndex in range(startIndex,len(nums)): ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results