LeetCode 87. Scramble String(字符串扰乱)

原题网址:https://leetcode.com/problems/scramble-string/

Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.

Below is one possible representation of s1 = "great":

    great
   /    \
  gr    eat
 / \    /  \
g   r  e   at
           / \
          a   t

你可能感兴趣的:(深度优先搜索,递归,剪枝,直方图,频率,同构,同构异形,对称,交换,树,leetcode)