Find the subvector with the sum closest to 0 , whats the best algorithm [O(nlgn)] you can design for this ?
Use prefix sum array, you should consider the first element
So after you get the minimum pair, you should compare it with a[0]…
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment