Skip to content

Commit 6481c34

Browse files
Merge pull request neetcode-gh#2772 from rlempka/cpp-0049-group-anagrams
Add # as separator in key formulation
2 parents a63303b + 340a837 commit 6481c34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/0049-group-anagrams.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class Solution {
3131
}
3232

3333
string key = "";
34-
for (int i = 0; i < 26; i++) {
35-
key.append(to_string(count[i] + 'a'));
34+
for (int i = 0; i < count.size(); i++) {
35+
key.append(to_string(count[i]) + '#');
3636
}
3737
return key;
3838
}

0 commit comments

Comments
 (0)