Skip to content

Commit 100ad7a

Browse files
committed
#567: description update
1 parent 8f65d1f commit 100ad7a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

c-sharp/Problems/sliding-window/PermutationInString.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,29 @@
1515
* Output: false
1616
*
1717
* Constraints:
18-
* • 1 <= s1.length, s2.length <= 104
18+
* • 1 <= s1.length, s2.length <= 10^4
1919
* • s1 and s2 consist of lowercase English letters.
20+
*
21+
* Hint 1:
22+
* Obviously, brute force will result in TLE. Think of something else.
23+
*
24+
* Hint 2:
25+
* How will you check whether one string is a permutation of another string?
26+
*
27+
* Hint 3:
28+
* One way is to sort the string and then compare.
29+
* But, Is there a better way?
30+
*
31+
* Hint 4:
32+
* If one string is a permutation of another string then they must one common metric.
33+
* What is that?
34+
*
35+
* Hint 5:
36+
* Both strings must have same character frequencies, if one is permutation of another.
37+
* Which data structure should be used to store frequencies?
38+
*
39+
* Hint 6:
40+
* What about hash table? An array of size 26?
2041
**
2142
* https://leetcode.com/problems/permutation-in-string/
2243
***/

0 commit comments

Comments
 (0)