<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[xuxumoi]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/xsloop</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; xsloop]]></copyright><item><title><![CDATA[PAT 1104. Sum of Number Segments (20)]]></title><link>https://blog.csdn.net/xsloop/article/details/50825772</link><guid>https://blog.csdn.net/xsloop/article/details/50825772</guid><author>xsloop</author><pubDate>Tue, 08 Mar 2016 11:18:48 +0800</pubDate><description><![CDATA[Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence {0.1, 0.2, 0.3, 0.4}, we have 10 segments: (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) ]]></description><category></category></item><item><title><![CDATA[LeetCode || 198. House Robber]]></title><link>https://blog.csdn.net/xsloop/article/details/50733366</link><guid>https://blog.csdn.net/xsloop/article/details/50733366</guid><author>xsloop</author><pubDate>Wed, 24 Feb 2016 20:41:20 +0800</pubDate><description><![CDATA[198. House Robber


You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them]]></description><category></category></item><item><title><![CDATA[LeetCode || 299. Bulls and Cows]]></title><link>https://blog.csdn.net/xsloop/article/details/50733215</link><guid>https://blog.csdn.net/xsloop/article/details/50733215</guid><author>xsloop</author><pubDate>Wed, 24 Feb 2016 20:13:55 +0800</pubDate><description><![CDATA[299. Bulls and Cows


You are playing the following Bulls and Cows game with your friend: You write down a number and
 ask your friend to guess what the number is. Each time your friend makes a gu]]></description><category></category></item><item><title><![CDATA[LeetCode ||326. Power of Three]]></title><link>https://blog.csdn.net/xsloop/article/details/50731987</link><guid>https://blog.csdn.net/xsloop/article/details/50731987</guid><author>xsloop</author><pubDate>Wed, 24 Feb 2016 16:49:21 +0800</pubDate><description><![CDATA[326. Power of Three


Given an integer, write a function to determine if it is a power of three.

Follow up:
Could you do it without using any loop / recursion?
方法一：
循环的方法，最直观简单。耗时128ms.
clas]]></description><category></category></item><item><title><![CDATA[LeetCode || Move Zeroes]]></title><link>https://blog.csdn.net/xsloop/article/details/50731725</link><guid>https://blog.csdn.net/xsloop/article/details/50731725</guid><author>xsloop</author><pubDate>Wed, 24 Feb 2016 16:27:02 +0800</pubDate><description><![CDATA[Move Zeroes
题目链接：Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.

For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, ]]></description><category></category></item><item><title><![CDATA[LeetCode || Nim Game]]></title><link>https://blog.csdn.net/xsloop/article/details/50731589</link><guid>https://blog.csdn.net/xsloop/article/details/50731589</guid><author>xsloop</author><pubDate>Wed, 24 Feb 2016 16:13:53 +0800</pubDate><description><![CDATA[Nim Game
基本思想：
	题目大致意思是：总共有N个球，A首先拿多少个球，然后B拿多少个球，单次拿球数量为1——3个之间，判断N为多少时A球必定能赢。
	这道题目的类似版本在很多公司面试中出现。
	主要是运用每次A拿m（1<=M<=3）个球，然后B拿4-m个球的思想来处理。

	那么，可以轻松将这道题目转变为，当总球数量N为能被4整除时，则B必定会赢，反之A会赢。]]></description><category></category></item><item><title><![CDATA[Job List]]></title><link>https://blog.csdn.net/xsloop/article/details/50254793</link><guid>https://blog.csdn.net/xsloop/article/details/50254793</guid><author>xsloop</author><pubDate>Thu, 10 Dec 2015 21:19:59 +0800</pubDate><description><![CDATA[继续~]]></description><category></category></item><item><title><![CDATA[LeetCode || First Bad Version]]></title><link>https://blog.csdn.net/xsloop/article/details/48375375</link><guid>https://blog.csdn.net/xsloop/article/details/48375375</guid><author>xsloop</author><pubDate>Fri, 11 Sep 2015 17:14:08 +0800</pubDate><description><![CDATA[// Forward declaration of isBadVersion API.
bool isBadVersion(int version);

class Solution {
public:
int firstBadVersion(int n) {
	if (n <= 1)
		return n;
	int i = 1, j = n;
	int mid = i / 2 + j / 2;]]></description><category></category></item><item><title><![CDATA[LeetCode || Factorial Trailing Zeroes]]></title><link>https://blog.csdn.net/xsloop/article/details/48371061</link><guid>https://blog.csdn.net/xsloop/article/details/48371061</guid><author>xsloop</author><pubDate>Fri, 11 Sep 2015 12:34:11 +0800</pubDate><description><![CDATA[class Solution {
public:
    int trailingZeroes(int n) {
        //找到所有的5
        int num = 0;
        while(n)
        {
            num += n/5;
            n = n / 5;
        }
        return num;
 ]]></description><category></category></item><item><title><![CDATA[LeetCode ||Number of Digit One]]></title><link>https://blog.csdn.net/xsloop/article/details/48371045</link><guid>https://blog.csdn.net/xsloop/article/details/48371045</guid><author>xsloop</author><pubDate>Fri, 11 Sep 2015 12:30:43 +0800</pubDate><description><![CDATA[class Solution {
public:
    int countDigitOne(int n) {
        
        if(n <=0)
            return 0;
        
        int ifac = 1;
        int front = 0;
        int back = 0;
        int curr =]]></description><category></category></item><item><title><![CDATA[LeetCode || Majority Element II]]></title><link>https://blog.csdn.net/xsloop/article/details/48370155</link><guid>https://blog.csdn.net/xsloop/article/details/48370155</guid><author>xsloop</author><pubDate>Fri, 11 Sep 2015 11:21:28 +0800</pubDate><description><![CDATA[class Solution {
public:
    vector majorityElement(vector& nums) {
        //每次取出来三个数，如果三个数均不相同，则都删除。
        
        if(nums.size() < 2)
            return nums;
        
        //找到数组中出现次数大于等于n/3]]></description><category></category></item><item><title><![CDATA[LeetCode || N-Queens II]]></title><link>https://blog.csdn.net/xsloop/article/details/48296055</link><guid>https://blog.csdn.net/xsloop/article/details/48296055</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 20:05:24 +0800</pubDate><description><![CDATA[使用全排列的思路，效率很低。
class Solution {
public:

    bool QueenOrderOK(const vector& q)
    {
        for(int i = 0 ;i<q.size();i++)
        {
            for(int j = i+1;j<q.size();j++)
            {
      ]]></description><category></category></item><item><title><![CDATA[LeetCode || Binary Tree Paths]]></title><link>https://blog.csdn.net/xsloop/article/details/48295483</link><guid>https://blog.csdn.net/xsloop/article/details/48295483</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 19:20:22 +0800</pubDate><description><![CDATA[/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
clas]]></description><category></category></item><item><title><![CDATA[LeetCode || Maximal Square]]></title><link>https://blog.csdn.net/xsloop/article/details/48293057</link><guid>https://blog.csdn.net/xsloop/article/details/48293057</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 16:37:25 +0800</pubDate><description><![CDATA[class Solution {
public:
    int maximalSquare(vector>& matrix) {
        int row = matrix.size();
        if(row == 0)
            return 0;
        int col = matrix[0].size();
        
        int i]]></description><category></category></item><item><title><![CDATA[LeetCode || Maximal Rectangle]]></title><link>https://blog.csdn.net/xsloop/article/details/48291861</link><guid>https://blog.csdn.net/xsloop/article/details/48291861</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 15:37:43 +0800</pubDate><description><![CDATA[class Solution {
public:
    int maximalRectangle(vector>& matrix) {
        int row = matrix.size();
        if(row == 0)
            return 0;
        int col = matrix[0].size();
        
        in]]></description><category></category></item><item><title><![CDATA[LeetCode || Set Matrix Zeroes]]></title><link>https://blog.csdn.net/xsloop/article/details/48289169</link><guid>https://blog.csdn.net/xsloop/article/details/48289169</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 12:00:34 +0800</pubDate><description><![CDATA[class Solution {
public:
    void setZeroes(vector>& matrix) {
        
        if(matrix.size() ==0 || matrix[0].size() == 0)
            return;
        
        int row = matrix.size(), col = matri]]></description><category></category></item><item><title><![CDATA[LeetCode ||Insertion Sort List]]></title><link>https://blog.csdn.net/xsloop/article/details/48288505</link><guid>https://blog.csdn.net/xsloop/article/details/48288505</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 11:14:48 +0800</pubDate><description><![CDATA[/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
public:
    ListNode* in]]></description><category></category></item><item><title><![CDATA[LeetCode || Gray Code]]></title><link>https://blog.csdn.net/xsloop/article/details/48286721</link><guid>https://blog.csdn.net/xsloop/article/details/48286721</guid><author>xsloop</author><pubDate>Tue, 08 Sep 2015 09:41:20 +0800</pubDate><description><![CDATA[class Solution {
public:
    vector grayCode(int n) {
        int size = 1 << n;
        vector r;
        for(int i = 0;i<size;i++)
        {
            int tmp = i^(i>>1);
            r.push_back(t]]></description><category></category></item><item><title><![CDATA[LeetCode || N-Queens]]></title><link>https://blog.csdn.net/xsloop/article/details/48263907</link><guid>https://blog.csdn.net/xsloop/article/details/48263907</guid><author>xsloop</author><pubDate>Mon, 07 Sep 2015 12:13:16 +0800</pubDate><description><![CDATA[使用全排列的方法做的，效率超低的，104ms.
class Solution {
public:
    bool CheckNQueuesOK(const vector& queen)
    {
        int len = queen.size();
        for(int i = 0;i<len;i++)
        {
            for(int j = ]]></description><category></category></item><item><title><![CDATA[LeetCode || Permutations]]></title><link>https://blog.csdn.net/xsloop/article/details/48263763</link><guid>https://blog.csdn.net/xsloop/article/details/48263763</guid><author>xsloop</author><pubDate>Mon, 07 Sep 2015 11:55:40 +0800</pubDate><description><![CDATA[class Solution {
public:

    void permutation(vector& nums, int start, vector>& permu)
    {
        if(start == nums.size())
        {
            permu.push_back(nums);
        }
        
        f]]></description><category></category></item></channel></rss>