Optimal Partition of String — CaffeCode