Solve 'scramble string' problem in leetcode, an O(n^3) solution using DP, and for each child nodes, verify at least their characters appear the same number of times.