10 Responses

  1. Jack Wu
    Jack Wu October 9, 2013 at 8:27 pm |

    Hey, neat code. Thanks for sharing.
    I have a question: What is the complexity of this solution?

  2. Scramble String | Jiting
    Scramble String | Jiting January 12, 2014 at 9:46 pm |

    […] 可以用bucket sort 来check,可以吧sot的nlgn降低为n。 […]

  3. Jimmy
    Jimmy February 7, 2014 at 12:02 am |

    I’m sorry to point that out, but this is not DP at all. This is clearly recursion since you are calling isScrambleHelper() inside itself, and it can not process through until the recursion call returns. There is indeed a DP solution to this problem however yours isn’t. The recursion version could pass OJ though.

  4. xpsmiler
    xpsmiler April 1, 2014 at 8:21 am |

    Time Limit Exceeded for “tqxpxeknttgwoppemjkivrulaflayn”, “afaylnlurvikjmeppowgttnkexpxqt”


Leave a Reply