187. Repeated DNA Sequences
2016-04-16 18:51
423 查看
//最懒方法嘿嘿 136ms class Solution { public: vector<string> findRepeatedDnaSequences(string s) { if(s.size()<=10) return {}; vector<string> v; unordered_map<string,bool> hash; for(int i=0;i<=s.size()-10;i++) { string s0=s.substr(i,10); if(hash.find(s0)!=hash.end()) { if(hash[s0]) v.push_back(s0); hash[s0]=false; } else hash[s0]=true; } return v; } };
相关文章推荐
- SGU 140 Integer Sequences(扩展欧几里得)
- AsyncQueryHander的用法
- iOS ---UICollectionView简单使用
- iOS --- UIcollectionView设置头尾
- IOS开发UI系列之常用类的继承关系层次图
- js 空数组是true还是false
- ACM学习历程—Hihocoder 1291 Building in Sandbox(dfs && 离线 && 并查集)
- Error:failed to find Build Tools revision 21.1.1
- 百度富文本编辑器Ueditor的使用
- 交叉编译liquid-dsp-1.2.0
- UIButton实现控制动画的开始和停止
- iOS---UIViewContentMode各类型效果
- sublime text2 build system 执行带中文路经文件
- iOS UITextField修改信息
- PHP-include和require
- 【问题】Failed to send producer request with correlation id 2 to broker 0 with
- UVALive 6195 —— The Dueling Philosophers Problem
- Map很多Key-Value对应是可以此来处理!
- UITableView 总结
- 界面编程与视图(view)组件——三种UI界面开发方式