<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[chenjn69的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/chenjn69</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; chenjn69]]></copyright><item><title><![CDATA[算法概论证明题]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/74455038</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/74455038</guid><author>chenjn69</author><pubDate>Wed, 05 Jul 2017 16:46:52 +0800</pubDate><description><![CDATA[题目：

　　若有一个图，其顶点数为偶数（比如2n），且其中的n个顶点构成一个团，其余的n个顶点则有一条称为“尾巴”的路径连接，尾巴的某个端点与团中一个顶点相连，这样的图称为“风筝图”。现给定一个图G和目标g，风筝图问题的目标是求出该图的一个包含2g个顶点的风筝子图。请证明该问题是NP-完全的。




证明：

　　我们可以将团问题归约到风筝图问题。团问题的目标是求出某图的一个]]></description><category></category></item><item><title><![CDATA[Rotate Array]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/74454377</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/74454377</guid><author>chenjn69</author><pubDate>Wed, 05 Jul 2017 16:33:57 +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 solution]]></description><category></category></item><item><title><![CDATA[K-diff Pairs in an Array]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/74453063</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/74453063</guid><author>chenjn69</author><pubDate>Wed, 05 Jul 2017 16:10:12 +0800</pubDate><description><![CDATA[题面：Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as
 an integer pair (i, j), where i and j are both numbe]]></description><category></category></item><item><title><![CDATA[Shortest Unsorted Continuous Subarray]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/74452645</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/74452645</guid><author>chenjn69</author><pubDate>Wed, 05 Jul 2017 15:59:45 +0800</pubDate><description><![CDATA[题面：

Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.

You need]]></description><category></category></item><item><title><![CDATA[66. Plus One]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72953750</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72953750</guid><author>chenjn69</author><pubDate>Fri, 09 Jun 2017 09:42:55 +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 d]]></description><category></category></item><item><title><![CDATA[Find the Duplicate Number]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72920961</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72920961</guid><author>chenjn69</author><pubDate>Thu, 08 Jun 2017 15:47:33 +0800</pubDate><description><![CDATA[题面：

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate num]]></description><category></category></item><item><title><![CDATA[216. Combination Sum III]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72885662</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72885662</guid><author>chenjn69</author><pubDate>Tue, 06 Jun 2017 17:36:33 +0800</pubDate><description><![CDATA[题目：

Find all possible combinations of k numbers that add up to a number n, given that only numbers
 from 1 to 9 can be used and each combination should be a unique set of numbers.


Example 1:]]></description><category></category></item><item><title><![CDATA[Two Sum II - Input array is sorted]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72884640</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72884640</guid><author>chenjn69</author><pubDate>Tue, 06 Jun 2017 16:25:13 +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]]></description><category></category></item><item><title><![CDATA[238. Product of Array Except Self]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72867735</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72867735</guid><author>chenjn69</author><pubDate>Mon, 05 Jun 2017 15:25:01 +0800</pubDate><description><![CDATA[题面：

Given an array of n integers where n > 1, nums,
 return an array output such that output[i] is
 equal to the product of all the elements of nums except nums[i].

Solve it without division a]]></description><category></category></item><item><title><![CDATA[第十一周作业： Find All Duplicates in an Array]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72858379</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72858379</guid><author>chenjn69</author><pubDate>Sun, 04 Jun 2017 12:50:14 +0800</pubDate><description><![CDATA[题面：

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

Find all the elements that appear twice in this array.

Could you do it wit]]></description><category></category></item><item><title><![CDATA[第十周作业： Add Digits]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72831937</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72831937</guid><author>chenjn69</author><pubDate>Thu, 01 Jun 2017 15:45:03 +0800</pubDate><description><![CDATA[题面：

Given a non-negative integer num, repeatedly add all its digits until the result has only
 one digit.

For example:

Given num = 38, the process is like: 3
 + 8 = 11, 1 + 1 = 2. Since 2 h]]></description><category></category></item><item><title><![CDATA[第九周作业：Fizz Buzz]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72831089</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72831089</guid><author>chenjn69</author><pubDate>Thu, 01 Jun 2017 14:41:27 +0800</pubDate><description><![CDATA[题面：Write a program that outputs the string representation of numbers from 1 to n.

But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz]]></description><category></category></item><item><title><![CDATA[第八周作业：Reverse Words in a String III]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72822444</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72822444</guid><author>chenjn69</author><pubDate>Wed, 31 May 2017 17:55:41 +0800</pubDate><description><![CDATA[题面：

Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

Example 1:

Input: "Let's take LeetCode]]></description><category></category></item><item><title><![CDATA[第七周作业：Array Partition I]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/72821935</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/72821935</guid><author>chenjn69</author><pubDate>Wed, 31 May 2017 17:10:32 +0800</pubDate><description><![CDATA[题面：

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1,
 b1), (a2, b2),
 ..., (an, bn) which makes sum of min(ai,
 bi) for all i from 1 to n as]]></description><category></category></item><item><title><![CDATA[第六周作业：Total Hamming Distance]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/67640213</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/67640213</guid><author>chenjn69</author><pubDate>Tue, 28 Mar 2017 18:35:21 +0800</pubDate><description><![CDATA[题目：

The Hamming distance between two integers is the number of positions at which the corresponding
 bits are different.

Now your job is to find the total Hamming distance between all pairs of ]]></description><category></category></item><item><title><![CDATA[第五周作业：Single Number III]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/67634840</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/67634840</guid><author>chenjn69</author><pubDate>Tue, 28 Mar 2017 13:31:51 +0800</pubDate><description><![CDATA[题目:

Given an array of numbers nums, in which exactly two elements appear only once and all
 the other elements appear exactly twice. Find the two elements that appear only once.

For example:
]]></description><category></category></item><item><title><![CDATA[第四周作业：Integer Replacement]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/64123573</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/64123573</guid><author>chenjn69</author><pubDate>Mon, 20 Mar 2017 11:34:49 +0800</pubDate><description><![CDATA[题目：

Given a positive integer n and you can do operations as follow:



If n is even, replace n with n/2.If n is odd, you can replace n with either n +
 1 or n - 1.



What is the minimum n]]></description><category></category></item><item><title><![CDATA[第三周作业：位运算]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/61195077</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/61195077</guid><author>chenjn69</author><pubDate>Fri, 10 Mar 2017 11:34:10 +0800</pubDate><description><![CDATA[题目：Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.
Note:


The given integer is guaranteed to fit within the range]]></description><category></category></item><item><title><![CDATA[第二周作业：roman to integer]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/60366465</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/60366465</guid><author>chenjn69</author><pubDate>Sat, 04 Mar 2017 23:22:15 +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.
代码：class Solution {
public:
    int romanToInt(string s) {
        int i;
        int]]></description><category></category></item><item><title><![CDATA[第一周作业：11 container with most water]]></title><link>https://blog.youkuaiyun.com/chenjn69/article/details/57130580</link><guid>https://blog.youkuaiyun.com/chenjn69/article/details/57130580</guid><author>chenjn69</author><pubDate>Sat, 25 Feb 2017 22:11:57 +0800</pubDate><description><![CDATA[题目：
Given n non-negative integers a1,
a2, ..., an, where each represents a point at coordinate (i,
ai). n vertical lines are drawn such that the two endpoints of line
i is at (i, ai) and (i, 0). F]]></description><category></category></item></channel></rss>