We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef5f1ab commit bcea009Copy full SHA for bcea009
1 file changed
Python/k-similar-strings.py
@@ -1,7 +1,7 @@
1
-# Time: O(s * s!/(a!*...*z!)), s is the length of A, B,
2
-# a...z is the count of each alphabet,
3
-# sum(a...z) = s
4
-# Space: O(s * s!/(a!*...*z!))
+# Time: O(n * n!/(c_a!*...*c_z!), n is the length of A, B,
+# c_a...c_z is the count of each alphabet,
+# n = sum(c_a...c_z)
+# Space: O(n * n!/(c_a!*...*c_z!)
5
6
# Strings A and B are K-similar (for some non-negative integer K)
7
# if we can swap the positions of two letters
0 commit comments