1class Solution {2public:3vector<string> findRepeatedDnaSequences(string s) {4unordered_map<string, int> freq;5int start = 0, end = 9;6while (end < s.size()) {7bool flag = true;8for (int i = start; i <= end; i++) {9if (s[i] == 'A' or s[i] == 'C' or s[i] == 'G' or s[i] == 'T')10continue;11else {12flag = false;13break;14}15}16if (flag) {17string temp = s.substr(start, 10);18freq[temp]++;19}20start++;21end++;22}23vector<string> ans;24for (auto it : freq) {25if (it.second >= 2) ans.push_back(it.first);26}27return ans;28}29};