Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar14 / src.cpp
diff options
context:
space:
mode:
Commitf649b212535ef5ea791f0f32455c21a8f02ccbc2 (patch)
Author
 Stoycho Kyosev <stoycho.kk@gmail.com>
2023-01-19 08:19:13 +0200
Committer
 Stoycho Kyosev <stoycho.kk@gmail.com>
2023-01-19 08:19:13 +0200
Filesb9f4d3ed3f0cefc6ba00591ea7779cfb7fba5cae /Seminar14/src.cpp
Data-structures-and-algorithms-f649b212535ef5ea791f0f32455c21a8f02ccbc2.tar
Data-structures-and-algorithms-f649b212535ef5ea791f0f32455c21a8f02ccbc2.tar.gz
Data-structures-and-algorithms-f649b212535ef5ea791f0f32455c21a8f02ccbc2.zip
Parent0313d65d247b94a46084f8410e247aacbc86159d (diff)
Add Sem14
1 files changed, 18 insertions, 0 deletions
-rw-r--r--Seminar14/src.cpp18
diff --git a/Seminar14/src.cpp b/Seminar14/src.cpp
new file mode 100644
index 0000000..ff176fd
--- /dev/null
+++ b/Seminar14/src.cpp
@@ -0,0 +1,18 @@
+#include<iostream>
+#include<unordered_map>
+
+int main() {
+ std::string example = "abcbabc";
+ std::unordered_map<char, int> mp;
+ int cnt = 1;
+
+ for(char c : example) {
+ if(mp[c] > 0) {
+ ++cnt;
+ mp.clear();
+ }
+ mp[c]++;
+ }
+
+ std::cout << cnt;
+} \ No newline at end of file