soulmachine / leetcode

LeetCode题解,151道题完整版。
BSD 3-Clause "New" or "Revised" License
11.3k stars 3.43k forks source link

Scramble string complexity #35

Open ethanboyuan opened 10 years ago

ethanboyuan commented 10 years ago

I have a doubt about the complexity of the recursive method. This should not be n^6. The worst case should be 6^n instead of n^6.

soulmachine commented 10 years ago

Well, I'll take a look at it

hqztrue commented 4 years ago

The time complexity for dynamic programming should be O(n^4).