Maximum Number of Ways to Partition an Array