<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[抹茶小一的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Matcha_ee</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Matcha_ee]]></copyright><item><title><![CDATA[LeetCode - 136. Single Number]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/59635966</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/59635966</guid><author>Matcha_ee</author><pubDate>Thu, 02 Mar 2017 19:53:24 +0800</pubDate><description><![CDATA[题目：

Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without usin]]></description><category></category></item><item><title><![CDATA[LeetCode - 242. Valid Anagram]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/59525695</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/59525695</guid><author>Matcha_ee</author><pubDate>Thu, 02 Mar 2017 15:55:46 +0800</pubDate><description><![CDATA[题目：

Given two strings s and t, write a function to determine if 
t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.
Note:
You ma]]></description><category></category></item><item><title><![CDATA[leetCode - 496. Next Greater Element I]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/58588019</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/58588019</guid><author>Matcha_ee</author><pubDate>Tue, 28 Feb 2017 11:52:50 +0800</pubDate><description><![CDATA[题目：

You are given two arrays (without duplicates) nums1 and
nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for
nums1's elements in the corresponding places of]]></description><category></category></item><item><title><![CDATA[LeetCode - 350. Intersection of Two Arrays II]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/58257746</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/58257746</guid><author>Matcha_ee</author><pubDate>Mon, 27 Feb 2017 21:32:43 +0800</pubDate><description><![CDATA[题目：

Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return
[2, 2].
Note:


Each element in the result should appear as ]]></description><category></category></item><item><title><![CDATA[LeetCode - 349. Intersection of Two Arrays]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/58252168</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/58252168</guid><author>Matcha_ee</author><pubDate>Mon, 27 Feb 2017 21:10:52 +0800</pubDate><description><![CDATA[题目：

Given two arrays, write a function to compute their intersection.
Example:
Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return
[2].
Note:


Each element in the result must be unique.The r]]></description><category></category></item><item><title><![CDATA[LeetCode - 35. Search Insert Position]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56846090</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56846090</guid><author>Matcha_ee</author><pubDate>Fri, 24 Feb 2017 17:30:18 +0800</pubDate><description><![CDATA[题目：

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the a]]></description><category></category></item><item><title><![CDATA[LeetCode - 66. Plus One]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56841098</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56841098</guid><author>Matcha_ee</author><pubDate>Fri, 24 Feb 2017 14:53:37 +0800</pubDate><description><![CDATA[题目：
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.
You may assume the integer do not contain any leading zero, except the number 0 itself.
The dig]]></description><category></category></item><item><title><![CDATA[LeeyCode - 167. Two Sum II - Input array is sorted]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56670525</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56670525</guid><author>Matcha_ee</author><pubDate>Thu, 23 Feb 2017 13:56:33 +0800</pubDate><description><![CDATA[题目：

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two n]]></description><category></category></item><item><title><![CDATA[LeetCode - 268. Missing Number]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56501071</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56501071</guid><author>Matcha_ee</author><pubDate>Wed, 22 Feb 2017 22:51:25 +0800</pubDate><description><![CDATA[题目：
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.


思路与步骤：
思路1：
先排序，然后将数组与下标比较，第一次出现不相等的下标即确实数据。

学习别人的思路：

思路2：
先对0到]]></description><category></category></item><item><title><![CDATA[LeetCode - 189. Rotate Array]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56489891</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56489891</guid><author>Matcha_ee</author><pubDate>Wed, 22 Feb 2017 17:52:27 +0800</pubDate><description><![CDATA[题目：

Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to
[5,6,7,1,2,3,4]. 
Note:
Try to come up as many solutions as]]></description><category></category></item><item><title><![CDATA[LeetCode - 141. Linked List Cycle]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56482244</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56482244</guid><author>Matcha_ee</author><pubDate>Wed, 22 Feb 2017 12:44:04 +0800</pubDate><description><![CDATA[题目：

Given a linked list, determine if it has a cycle in it.


思路与步骤：
采用“快慢指针”查检查链表是否含有环。让一个指针一次走一步，另一个一次走两步，如果链表中含有环，快指针会再次和慢指针相遇。


编程实现:
/**
 * Definition for singly-linked list.
 * class]]></description><category></category></item><item><title><![CDATA[leetCode - 459. Repeated Substring Pattern]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56296499</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56296499</guid><author>Matcha_ee</author><pubDate>Tue, 21 Feb 2017 20:40:46 +0800</pubDate><description><![CDATA[题目：
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase]]></description><category></category></item><item><title><![CDATA[LeetCode - 520. Detect Capital]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56288652</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56288652</guid><author>Matcha_ee</author><pubDate>Tue, 21 Feb 2017 17:56:23 +0800</pubDate><description><![CDATA[题目：

Given a word, you need to judge whether the usage of capitals in it is right or not.
We define the usage of capitals in a word to be right when one of the following cases holds:

All letters]]></description><category></category></item><item><title><![CDATA[LeetCode - 434. Number of Segments in a String]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56279860</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56279860</guid><author>Matcha_ee</author><pubDate>Tue, 21 Feb 2017 12:55:28 +0800</pubDate><description><![CDATA[题目：

Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.
Please note that the string does not contain any non-printable charact]]></description><category></category></item><item><title><![CDATA[LeetCode - 125. Valid Palindrome]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56038127</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56038127</guid><author>Matcha_ee</author><pubDate>Mon, 20 Feb 2017 22:13:56 +0800</pubDate><description><![CDATA[题目：
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.


思路与步骤：
首先理解题目要求：通过测试样例得知，输入的字符串只比较大小写字母和0-9，其中同一个字母的大小写认为一样，其他字忽略。于是有两种思路
思路1：]]></description><category></category></item><item><title><![CDATA[LeetCode - 67. Add Binary]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/56011797</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/56011797</guid><author>Matcha_ee</author><pubDate>Mon, 20 Feb 2017 13:23:21 +0800</pubDate><description><![CDATA[题目：
Given two binary strings, return their sum (also a binary string).


思路与步骤：
原思路：
将两个string逐个字符相加，设置一个flag ，进位的话记 flag=1，反之 flag=0
需要处理的一些细节：
1. a 和 b 的 0， 1 是字符形式，要写成 '0', '1'；flag 是 int 型]]></description><category></category></item><item><title><![CDATA[LeetCode - 28. Implement strStr()]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/55823863</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/55823863</guid><author>Matcha_ee</author><pubDate>Sun, 19 Feb 2017 22:19:55 +0800</pubDate><description><![CDATA[题目：

Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
思路与步骤：
两个字符串逐个字符比较，如果两个字符串第一个不同，则大的下标加1，小的不变，依次循环；
如果相同，则依次逐个比较]]></description><category></category></item><item><title><![CDATA[LeetCode - 20. Valid Parentheses]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/55806228</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/55806228</guid><author>Matcha_ee</author><pubDate>Sun, 19 Feb 2017 20:07:28 +0800</pubDate><description><![CDATA[题目：

Given a string containing just the characters '(', ')',
'{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all ]]></description><category></category></item><item><title><![CDATA[LeetCode - 13. Roman to Integer]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/55804630</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/55804630</guid><author>Matcha_ee</author><pubDate>Sun, 19 Feb 2017 15:24:04 +0800</pubDate><description><![CDATA[题目：

Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.


思路与步骤：
分两步进行，先对应，再计算。基本思路是：
    首先将 roman 基本字符与阿拉伯数字对应起来，存在一个结构中，然后对输入的字符串逐个字]]></description><category></category></item><item><title><![CDATA[LeetCode - 383. Ransom Note]]></title><link>https://blog.youkuaiyun.com/Matcha_ee/article/details/55273687</link><guid>https://blog.youkuaiyun.com/Matcha_ee/article/details/55273687</guid><author>Matcha_ee</author><pubDate>Thu, 16 Feb 2017 22:24:38 +0800</pubDate><description><![CDATA[题目：


Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magaz]]></description><category></category></item></channel></rss>