LeetCode #1664: Ways to Make a Fair Array