Separate Black and White Balls | Leetcode 2938