标签:desc logs ble href pre == .com amp leetcode
1 class Solution { 2 public: 3 vector<string> findRepeatedDnaSequences(string s) { 4 //A is 0101, C is 0103, G is 0107, T is 0124 //3bit to store 5 unordered_map<int,int> m; 6 vector<string> r; 7 int t=0,i=0,ss=s.length(); 8 while(i<9) 9 t=t<<3|s[i++]&7; 10 while(i<ss) 11 if(m[t=t<<3&0x3fffffff|s[i++]&7]++==1) 12 r.push_back(s.substr(i-10,10)); 13 return r; 14 } 15 };
leetcode187. Repeated DNA Sequences
标签:desc logs ble href pre == .com amp leetcode
原文地址:http://www.cnblogs.com/weedboy/p/6814223.html