位运算大法好
值得注意 例如0xff 一个f表示15 二进制中表示1111
 
 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的更多相关文章

  1. Leetcode187. Repeated DNA Sequences重复的DNA序列

    所有 DNA 由一系列缩写为 A,C,G 和 T 的核苷酸组成,例如:"ACGAATTCCG".在研究 DNA 时,识别 DNA 中的重复序列有时会对研究非常有帮助. 编写一个函数 ...

  2. LeetCode 187. 重复的DNA序列(Repeated DNA Sequences)

    187. 重复的DNA序列 187. Repeated DNA Sequences 题目描述 All DNA is composed of a series of nucleotides abbrev ...

  3. lc面试准备:Repeated DNA Sequences

    1 题目 All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: &quo ...

  4. [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 ...

  5. [LeetCode] Repeated DNA Sequences 求重复的DNA序列

    All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...

  6. [Leetcode] Repeated DNA Sequences

    All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...

  7. 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 ...

  8. 【leetcode】Repeated DNA Sequences(middle)★

    All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...

  9. LeetCode() Repeated DNA Sequences 看的非常的过瘾!

    All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...

随机推荐

  1. 我的Apache又挂了之apache错误:server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName'

    表示物理机装Apache然后有时候关机会忘了关闭Apache然后长此以往会导致各种Apache起不来的缘故,上一次已经出现过一次.今天又出现了 再次记录一下解决的方法. 1.查看错误日志 /var/l ...

  2. python模块分析之sqlite3数据库

    SQLite作为一种应用广泛的文件式关系型数据库,python操作sqlite主要有两种方式,原生SQL语句和ORM映射工具. SQLAlchemy连接SQLITE SQLAlchemy是一款优秀的p ...

  3. C# 操作IitextPdf

    1.读取PDF内容 public string ReadPdfFile(string fileName) { StringBuilder text = new StringBuilder(); if ...

  4. Python学习笔记——数据结构和算法(二)

    1.字典中一个键映射多个值 可以使用collections中的defaultdict来实现,defalultdict接受list或者set为参数 from collections import def ...

  5. SYN Flood攻击及防御方法 (转)

    原文连接:http://blog.csdn.net/bill_lee_sh_cn/article/details/6065704 一.为什么Syn Flood会造成危害      这要从操作系统的TC ...

  6. jQuery对的表单数据序列化和校验

    jQuery对的表单数据序列化和校验 表单序列化 如果想让表单通过ajax异步提交,那么首先我们要通过js获取到每个表单中输入的值,如果表单项比较多的话,是一件很麻烦,很痛苦的事情,那么我们可以通过j ...

  7. C#串口serialPort操作

    现在大多数硬件设备均采用串口技术与计算机相连,因此串口的应用程序开发越来越普遍.例如,在计算机没有安装网卡的情况下,将本机上的一些信息数据 传输到另一台计算机上,那么利用串口通信就可以实现.运行本程序 ...

  8. Delphi 绘图对象

    来自:http://blog.csdn.net/lailai186/article/details/8755430 ========================================== ...

  9. LeetCode818. Race Car

    https://leetcode.com/problems/race-car/description/ Your car starts at position 0 and speed +1 on an ...

  10. c# 递归异步获取本地驱动器下所有文件

    //获取所有驱动器 string[] drives = Environment.GetLogicalDrives(); foreach (string driver in drives) { Cons ...