[rewrite] max sub array