Skip to content

Commit 7bf2064

Browse files
authored
Create minimize-string-length.cpp
1 parent 6f2b502 commit 7bf2064

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

C++/minimize-string-length.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Time: O(n)
2+
// Space: O(1)
3+
4+
// hash table
5+
class Solution {
6+
public:
7+
int minimizedStringLength(string s) {
8+
return size(unordered_set<char>(cbegin(s), cend(s)));
9+
}
10+
};

0 commit comments

Comments
 (0)