<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[chengych的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/chengych</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; chengych]]></copyright><item><title><![CDATA[算法概论习题 8.22 NP-完全问题证明]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/54177907</link><guid>https://blog.youkuaiyun.com/chengych/article/details/54177907</guid><author>chengych</author><pubDate>Sat, 07 Jan 2017 21:03:47 +0800</pubDate><description><![CDATA[题目：8.22 
问题描述： 在任务调度，它常常可以用图进行每个任务的节点和有向边的任务我的任务，如果我是一个先决条件J.这个有向图描绘的优先约束的调度问题。显然，当且仅当图是循环的时，调度是可能的；如果它不是，我们想确定必须丢弃的最小数量的约束，以便使其循环。

给定一个有向图G =（V，E），子集E0⊆E称为反馈弧集如果边E0呈现G环的去除。

反馈弧集（FAS）：给定一个有向图G ]]></description><category></category></item><item><title><![CDATA[【leetcode】45. Jump Game II]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52854394</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52854394</guid><author>chengych</author><pubDate>Tue, 18 Oct 2016 23:32:02 +0800</pubDate><description><![CDATA[Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.

Your goal is ]]></description><category></category></item><item><title><![CDATA[【leetcode】55. Jump Game]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52854267</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52854267</guid><author>chengych</author><pubDate>Tue, 18 Oct 2016 23:13:24 +0800</pubDate><description><![CDATA[Difficulty:Medium




Given an array of non-negative integers, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at th]]></description><category></category></item><item><title><![CDATA[【leetcode】188. Best Time to Buy and Sell Stock IV]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52853981</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52853981</guid><author>chengych</author><pubDate>Tue, 18 Oct 2016 22:42:04 +0800</pubDate><description><![CDATA[Difficulty:Hard

Say you have an array for which the ith element is the price of a given stock on day
i.
Design an algorithm to find the maximum profit. You may complete at most 
k transactions.]]></description><category></category></item><item><title><![CDATA[【leetcode】123. Best Time to Buy and Sell Stock III]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52762179</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52762179</guid><author>chengych</author><pubDate>Sun, 09 Oct 2016 00:52:11 +0800</pubDate><description><![CDATA[Difficulty：Hard




Say you have an array for which the ith element is the price of a given stock on day i.

Design an algorithm to find the maximum profit. You may complete at most two transac]]></description><category></category></item><item><title><![CDATA[【leetcode】122. Best Time to Buy and Sell Stock II]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52762170</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52762170</guid><author>chengych</author><pubDate>Sun, 09 Oct 2016 00:46:30 +0800</pubDate><description><![CDATA[Difficulty：Medium


Say you have an array for which the ith element is the price of a given stock on day i.

Design an algorithm to find the maximum profit. You may complete as many transactions ]]></description><category></category></item><item><title><![CDATA[【leetcode】121. Best Time to Buy and Sell Stock]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52762147</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52762147</guid><author>chengych</author><pubDate>Sun, 09 Oct 2016 00:40:31 +0800</pubDate><description><![CDATA[Difficulty:Easy


ay you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (ie, buy one and sell one]]></description><category></category></item><item><title><![CDATA[【leetcode】75. Sort ColorsD]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52708118</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52708118</guid><author>chengych</author><pubDate>Fri, 30 Sep 2016 00:49:40 +0800</pubDate><description><![CDATA[Difficulty:Medium


Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.

Here, we]]></description><category></category></item><item><title><![CDATA[【leetcode】215. Kth Largest Element in an Array]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52707099</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52707099</guid><author>chengych</author><pubDate>Fri, 30 Sep 2016 00:36:19 +0800</pubDate><description><![CDATA[Difficulty:Medium




Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.

For example,
Given [3,2,1,5]]></description><category></category></item><item><title><![CDATA[【leetcode】4. Median of Two Sorted Arrays]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52706129</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52706129</guid><author>chengych</author><pubDate>Thu, 29 Sep 2016 23:43:53 +0800</pubDate><description><![CDATA[Difficulty:Hard


There are two sorted arrays nums1 and nums2 of size m and n respectively.

Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

E]]></description><category></category></item><item><title><![CDATA[【leetcode】34. Search for a Range]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52605234</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52605234</guid><author>chengych</author><pubDate>Wed, 21 Sep 2016 10:28:46 +0800</pubDate><description><![CDATA[Difficulty：medium


Given a sorted array of integers, find the starting and ending position of a given target value.

Your algorithm's runtime complexity must be in the order of O(log n).

If t]]></description><category></category></item><item><title><![CDATA[【leetcode】74. Search a 2D Matrix]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52604714</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52604714</guid><author>chengych</author><pubDate>Wed, 21 Sep 2016 09:49:25 +0800</pubDate><description><![CDATA[Difficulty:medium


Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:



Integers in each row are sorted from left to right.Th]]></description><category></category></item><item><title><![CDATA[【leetcode】35. Search Insert Position]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52604563</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52604563</guid><author>chengych</author><pubDate>Wed, 21 Sep 2016 09:35:18 +0800</pubDate><description><![CDATA[Difficulty:medium


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 d]]></description><category></category></item><item><title><![CDATA[【leetcode】33. Search in Rotated Sorted Array]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52590909</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52590909</guid><author>chengych</author><pubDate>Tue, 20 Sep 2016 00:27:18 +0800</pubDate><description><![CDATA[Difficulty：hard

Suppose a sorted array is rotated at some pivot unknown to you beforehand.

(i.e., 0 1 2 4 5 6 7 might become 4
 5 6 7 0 1 2).

You are given a target value to search. If found]]></description><category></category></item><item><title><![CDATA[【leetcode】162. Find Peak Element]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52590874</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52590874</guid><author>chengych</author><pubDate>Tue, 20 Sep 2016 00:14:58 +0800</pubDate><description><![CDATA[Difficulty：medium




A peak element is an element that is greater than its neighbors.

Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.

The array may ]]></description><category></category></item><item><title><![CDATA[【leetcode】120. Triangle]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52536879</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52536879</guid><author>chengych</author><pubDate>Wed, 14 Sep 2016 12:15:46 +0800</pubDate><description><![CDATA[Difficulty：medium

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.

For example, given the following triangle

[
    ]]></description><category></category></item><item><title><![CDATA[【leetcode】80. Remove Duplicates from Sorted Array II]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52536786</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52536786</guid><author>chengych</author><pubDate>Wed, 14 Sep 2016 12:04:50 +0800</pubDate><description><![CDATA[Difficulty：Medium


Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?

For example,
Given sorted array nums = [1,1,1,2,2,3],

Your function should return length]]></description><category></category></item><item><title><![CDATA[318. Maximum Product of Word Lengths]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52531225</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52531225</guid><author>chengych</author><pubDate>Tue, 13 Sep 2016 23:53:16 +0800</pubDate><description><![CDATA[Difficulty:Medium




Given a string array words, find the maximum value of length(word[i])
 * length(word[j]) where the two words do not share common letters. You may assume that each word will]]></description><category></category></item><item><title><![CDATA[383. Ransom Note]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52518678</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52518678</guid><author>chengych</author><pubDate>Mon, 12 Sep 2016 23:43:35 +0800</pubDate><description><![CDATA[Difficulty:easy

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   not]]></description><category></category></item><item><title><![CDATA[387. First Unique Character in a String]]></title><link>https://blog.youkuaiyun.com/chengych/article/details/52518651</link><guid>https://blog.youkuaiyun.com/chengych/article/details/52518651</guid><author>chengych</author><pubDate>Mon, 12 Sep 2016 23:36:28 +0800</pubDate><description><![CDATA[Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.

Examples:
s = "leetcode"
return 0.

s = "loveleetcode",
return 2.




Note:]]></description><category></category></item></channel></rss>