Added nlogn maxsubrange algirithm.