We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f2b502 commit 7bf2064Copy full SHA for 7bf2064
C++/minimize-string-length.cpp
@@ -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