using set
max subarray
minimum total O(n) space
sqrt bs