From 83f884f5a43cdcd621b8561bb2367a2e1feb9d30 Mon Sep 17 00:00:00 2001 From: JZFamily Date: Sun, 24 Jun 2018 12:19:19 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E5=88=B7=E9=A2=98.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LeetCode-CN/刷题.md | 116 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/LeetCode-CN/刷题.md b/LeetCode-CN/刷题.md index 727f43f..b07519f 100644 --- a/LeetCode-CN/刷题.md +++ b/LeetCode-CN/刷题.md @@ -573,5 +573,121 @@ public: } }; ``` +# 28. 实现strStr() @2018/06/23 +### jzf + +* 第一版 4ms + +```c++ +class Solution { +public: + int strStr(string haystack, string needle) { + string::iterator ihay; + string::iterator inee; + int ni =haystack.size(); + int nn =needle.size(); + int ret = -1; + + if(nn==0) + { + return 0; + } + if(ni= size_a || haystack.at(i + j) != needle.at(j)) + { + flag = false; + break; + } + } + + if (flag) + { + return i; + } + } + } + + return -1; + } +}; +``` +### 北河 +## 823. Binary Trees With Factors@2018/06/23 + +## 196. 删除重复的电子邮箱@2018/06/23 + +### 北河 +* +```sql +delete from Person where id in (select c.id from (select a.id from Person a join Person b on a.Email = b.Email and a.Id > b.Id) c); +```