Time complexity of recursive + for-loop alg?

  • 0

    I know the solution below is sub-optimal, but would appreciate a second pair of eyes on big-O

    Let N = s.length(), worst case is: O(N!) time and O(N) extra space (for call stack). Do you agree?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.