We can create two sets SSS_S and STS_T by generating kk-shingles for the strings SS and TT, respectively. Then we can calculate the intersection SIS_I and union SUS_U between the two sets. Finally, we need to divide the length of SIS_I by the length of SUS_U.

Complexity: O(S×T)O(|S|\times |T|)

Contributors

Statistics

87% Solution Ratio
fextivityEarliest, Dec '21
uchiha6125Fastest, 0.0s
TrAdBuLightest, 213 kB
white_monsterShortest, 158B
Toph uses cookies. By continuing you agree to our Cookie Policy.