给定一个 array,只包含 0,1, 找到一个分割位置,使左侧 0 出现的个数和右侧 1 出现的个数之和最 大化
brute force, time: O(n^2), space: O(1)
follow up, can we solve in O(n): DP, two temp array-google 1point3acres
follow up, can we use O(1) space: count all 1, traverse array from left , if encounter 0, add 1, else , minus 1