MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / L0087_ScrambleString

Class L0087_ScrambleString

src/main/java/L0087_ScrambleString.java:37–108  ·  view source on GitHub ↗

https://leetcode.cn/problems/scramble-string/ 使用下面描述的算法可以扰乱字符串 s 得到字符串 t : 1. 如果字符串的长度为 1 ,算法停止 2. 如果字符串的长度 > 1 ,执行下述步骤: - 在一个随机下标处将字符串分割成两个非空的子字符串。即,如果已知字符串 s ,则可以将其分成两个子字符串 x 和 y ,且满足 s = x + y 。 - 随机 决定是要「交换两个子字符串」还是要「保持这两个子字符串的顺序不变」。即,在执行这一步骤之后,s 可能是 s = x + y 或者 s = y + x 。 - 在 x 和 y

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected