Ontheway I woulddoitmightbesomethinglikethis, I wouldsay.
Okay, I noticedthattheirpolicyofmembershereinthisexampleonalsonegativenumbersonIfweonlyhadpositivenumbers, let's say 1 to 1, thentheproblemwouldbemucheasier, becausethenthemaximumsubarraywouldjustbethewholerape.
Sowhatmakes a hardisthefactthatwehavenegativenumbers.
Sotheonesstartingatthefirstthingnextandthentheonesstartingatthesecondindexand I willcomputethesumforeachsubarrayon.
I wasjustpickedalongwiththemaximumsome.
Soit's a bootforstrategy.
Andthen I wouldasktotheinterviewerthous, thisseemedlike a goodstrategywhenyousaythatyou'reessentiallygivingsomespacedutyinterviewersotheycangiveyoufeedbackastoifyou'regoinginthewrongdirection.