class Solution {
public:
vector<string> findRepeatedDnaSequences(string s) {
//A is 0101, C is 0103, G is 0107, T is 0124 //3bit to store
unordered_map<int,int> m;
vector<string> r;
int t=,i=,ss=s.length();
while(i<)
t=t<<|s[i++]&;
while(i<ss)
if(m[t=t<<&0x3fffffff|s[i++]&]++==)
r.push_back(s.substr(i-,));
return r;
}
};
leetcode187. Repeated DNA Sequences的更多相关文章
-
Leetcode187. Repeated DNA Sequences重复的DNA序列
所有 DNA 由一系列缩写为 A,C,G 和 T 的核苷酸组成,例如:"ACGAATTCCG".在研究 DNA 时,识别 DNA 中的重复序列有时会对研究非常有帮助. 编写一个函数 ...
-
LeetCode 187. 重复的DNA序列(Repeated DNA Sequences)
187. 重复的DNA序列 187. Repeated DNA Sequences 题目描述 All DNA is composed of a series of nucleotides abbrev ...
-
lc面试准备:Repeated DNA Sequences
1 题目 All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: &quo ...
-
[Swift]LeetCode187. 重复的DNA序列 | Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
-
[LeetCode] Repeated DNA Sequences 求重复的DNA序列
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
-
[Leetcode] Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
-
leetcode 187. Repeated DNA Sequences 求重复的DNA串 ---------- java
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
-
【leetcode】Repeated DNA Sequences(middle)★
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
-
LeetCode() Repeated DNA Sequences 看的非常的过瘾!
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
随机推荐
-
usb中的传输模式
别人总结的一个usb传输模式,保存一下 usb中的endpoint(端点)和传输模式 端点: 端点位于USB 外设内部,所有通信数据的来源或目的都基于这些端点,是一个可寻址的FIFO. 每个USB 外 ...
-
[转载] linux 速查表
原文: http://www.nixtutor.com/linux/all-the-best-linux-cheat-sheets/ 1. Linux Command Line Linux Refer ...
-
1.6Linux设备驱动
1.设备驱动的作用: 计算机系统的运行是软硬件共同作用的结果.如果应用程序直接访问硬件,会造成应用程序与硬件耦合度过高(了解面向对象的读者会很容易想到,降低对象与对象之间的耦合度最有效的方法是通过接口 ...
-
WinHTTP Web Proxy Auto-Discovery Service
下面是网上搜集的,个人没有做测试,----------------------------- WinHTTP Web Proxy Auto-Discovery Service 服务成功发送一个 开始 ...
-
快速搭建Web环境 Angularjs + Express3 + Bootstrap3
快速搭建Web环境 Angularjs + Express3 + Bootstrap3 AngularJS体验式编程系列文章, 将介绍如何用angularjs构建一个强大的web前端系统.angula ...
-
app抓包
http://www.360doc.com/content/14/1126/11/9200790_428168701.shtml 记得下载证书 不然有些网站是抓不到的
-
Backtrack下的dns爆破工具的目录
直接可以切换到 /pentest/enumeration/dns#
-
解决Windows Server 2008R2通过计划任务定时执行bat文件,显示成功但实际未执行
前段时间在Windows Server 2008安装了一套基于MySQL数据库的软件,处于数据安全的考虑,希望每天能够自动进行数据库备份.我在别人脚本的基础上自己写了一个数据库备份的bat脚本,双击该 ...
-
ActiveMQ进阶配置
配置web管理页面的安全认证 配置web管理页面的绑定IP和端口 配置MQ连接的安全认证 禁用不使用的连接协议 绑定协议连接端口到指定IP 使用MySql作为持久化保存 配置基于JDBC的高可用环境 ...
-
xml和json格式输出
<?php class Response{ const JSON ='json'; /* * 按综合方式输出通信数据 * @param integer $ ...