<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[hling_so的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/hling_so</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; hling_so]]></copyright><item><title><![CDATA[最近一些练习]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/79582335</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/79582335</guid><author>hling_so</author><pubDate>Fri, 16 Mar 2018 15:25:18 +0800</pubDate><description><![CDATA[1.

#include&amp;lt;iostream&amp;gt;
#include&amp;lt;vector&amp;gt;
#include&amp;lt;algorithm&amp;gt;
#include&amp;lt;climits&amp;gt;

using namespace std;

int dfs(vector&amp;lt;int&amp;gt;&amp;amp; h, int j0, int j1, int j2, int cur) {
    in...]]></description><category></category></item><item><title><![CDATA[牛客网-腾讯编程题]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/79556824</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/79556824</guid><author>hling_so</author><pubDate>Wed, 14 Mar 2018 16:44:39 +0800</pubDate><description><![CDATA[1 编码



题目描述

假定一种编码的编码范围是a ~ y的25个字母，从1位到4位的编码，如果我们把该编码按字典序排序，形成一个数组如下： a, aa, aaa, aaaa, aaab, aaac, … …, b, ba, baa, baaa, baab, baac … …, yyyw, yyyx, yyyy 其中a的Index为0，aa的Index为1，aaa的Index为2，以此类推。 ...]]></description><category></category></item><item><title><![CDATA[23. Merge k Sorted Lists]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78994370</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78994370</guid><author>hling_so</author><pubDate>Sun, 07 Jan 2018 13:44:19 +0800</pubDate><description><![CDATA[题目

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.



题意

合并k个有序链表成1个有序链表



分析

将合并k个成1个链表 分解为: k个链表两两合并, 之后得到的k’链表再两两合并,直到最后只剩下一个链表



实现

class S]]></description><category></category></item><item><title><![CDATA[4. Median of Two Sorted Arrays]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78993954</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78993954</guid><author>hling_so</author><pubDate>Sun, 07 Jan 2018 12:11:42 +0800</pubDate><description><![CDATA[题目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)).Example 1:nums1 = [1, 3]
nums]]></description><category></category></item><item><title><![CDATA[ex.8.3]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78946795</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78946795</guid><author>hling_so</author><pubDate>Mon, 01 Jan 2018 19:23:47 +0800</pubDate><description><![CDATA[题目STINGY SAT is the following problem:given a set of clauses(each a disjunction of literals) and an integer k, find a satisfy assignment in which at most k variables are true, if such an assignment exi]]></description><category></category></item><item><title><![CDATA[695. Max Area of Island]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78925738</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78925738</guid><author>hling_so</author><pubDate>Thu, 28 Dec 2017 19:55:39 +0800</pubDate><description><![CDATA[题目Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surro]]></description><category></category></item><item><title><![CDATA[100. Same Tree]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78896524</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78896524</guid><author>hling_so</author><pubDate>Mon, 25 Dec 2017 20:32:07 +0800</pubDate><description><![CDATA[题目Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Example 1:I]]></description><category></category></item><item><title><![CDATA[127. Word Ladder]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78896205</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78896205</guid><author>hling_so</author><pubDate>Mon, 25 Dec 2017 19:53:24 +0800</pubDate><description><![CDATA[题目Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
Only one letter can be changed at a ti]]></description><category></category></item><item><title><![CDATA[104. Maximum Depth of Binary Tree]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78895938</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78895938</guid><author>hling_so</author><pubDate>Mon, 25 Dec 2017 19:26:15 +0800</pubDate><description><![CDATA[题目Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.题意分析实现/**
 * Definition for a binary tree]]></description><category></category></item><item><title><![CDATA[515. Find Largest Value in Each Tree Row]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78895908</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78895908</guid><author>hling_so</author><pubDate>Mon, 25 Dec 2017 19:22:23 +0800</pubDate><description><![CDATA[题目You need to find the largest value in each row of a binary tree.Example: 
Input:       1
     / \
    3   2
   / \   \  
  5   3   9 
Output: [1, 3, 9]题意分析实现/**
/**
 * Definition for a binary tree no]]></description><category></category></item><item><title><![CDATA[513. Find Bottom Left Tree Value]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78895853</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78895853</guid><author>hling_so</author><pubDate>Mon, 25 Dec 2017 19:14:39 +0800</pubDate><description><![CDATA[题目Given a binary tree, find the leftmost value in the last row of the tree.Example 1: 
Input:  2
 / \
1   3
Output: 
1 
Example 2:  
Input:    1
   / \
  2   3
 /   / \
4   5   6
   /
  7
Output: 
7 
N]]></description><category></category></item><item><title><![CDATA[746. Min Cost Climbing Stairs]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78888597</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78888597</guid><author>hling_so</author><pubDate>Sun, 24 Dec 2017 23:51:24 +0800</pubDate><description><![CDATA[题目题意cost数组存放了每一级楼梯的花费, 要经过这一级就要付出相应的花费, 每次可以走1~2级, 可以选择从第0级和第1级开始走, 问走到顶(n)的最少花费是多少?(级数从0开始编号,对应开销cost[0])分析一些转化: 
可以选择从第0级和第1级开始走->加一个第-1级,cost为0,从-1级出发 
走到顶(n)->加一个第n级, cost为0, 走到第n级才算走完(前一步可以是n-1或者n]]></description><category></category></item><item><title><![CDATA[638. Shopping Offers]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78888593</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78888593</guid><author>hling_so</author><pubDate>Sun, 24 Dec 2017 23:51:00 +0800</pubDate><description><![CDATA[题目题意不同的商品i有不同需求needs[i] 
有些特价组合special[],对应每一种商品i有相应的数量,买相应的数量就可以用组合价(但是有一些组合未必会比单买便宜) 
求恰好买够需求needs[]的的最低总价.分析用动态规划+DFS 
每一次调用遍历一次组合special[i], 看剩余的需求里面能不能用组合i的方式购买,如果可以,则使用组合i,并且减去相应的need的数量,剩余的数量再调用]]></description><category></category></item><item><title><![CDATA[LL(1)语法分析器 c++实现]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78836648</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78836648</guid><author>hling_so</author><pubDate>Mon, 18 Dec 2017 20:21:00 +0800</pubDate><description><![CDATA[


结构
记号和规定
代码
Base.h
Base.cpp
LL1.h
LL1.cpp
main.cpp


测试样例









结构


main.cpp包含了主函数和LL1语法分析过程的调用 
Base.h和Base.cpp定义了类Base, 类Base用于存储产生式、符号表、FIRST集合FOLLOW集（还可应用于LR分析，故独立出来）
LL1.h和LL1.cpp定义了类


LL...]]></description><category></category></item><item><title><![CDATA[63. Unique Paths II]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78828775</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78828775</guid><author>hling_so</author><pubDate>Sun, 17 Dec 2017 22:54:07 +0800</pubDate><description><![CDATA[题目

Follow up for “Unique Paths”:

Now consider if some obstacles are added to the grids. How many unique paths would there be?

An obstacle and empty space is marked as 1 and 0 respectively in the gr...]]></description><category></category></item><item><title><![CDATA[740. Delete and Earn]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78828771</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78828771</guid><author>hling_so</author><pubDate>Sun, 17 Dec 2017 22:53:12 +0800</pubDate><description><![CDATA[题目

Given an array nums of integers, you can perform operations on the array.

In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every element equal ...]]></description><category></category></item><item><title><![CDATA[238. Product of Array Except Self]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78828759</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78828759</guid><author>hling_so</author><pubDate>Sun, 17 Dec 2017 22:51:23 +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 and in O(n).For]]></description><category></category></item><item><title><![CDATA[152. Maximum Product Subarray]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78828750</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78828750</guid><author>hling_so</author><pubDate>Sun, 17 Dec 2017 22:50:27 +0800</pubDate><description><![CDATA[题目

Find the contiguous subarray within an array (containing at least one number) which has the largest product.

For example, given the array [2,3,-2,4], 
the contiguous subarray [2,3] has the larges...]]></description><category></category></item><item><title><![CDATA[309. Best Time to Buy and Sell Stock with Cooldown]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78767470</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78767470</guid><author>hling_so</author><pubDate>Sun, 10 Dec 2017 21:03:40 +0800</pubDate><description><![CDATA[题目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 as you like (ie, buy one a]]></description><category></category></item><item><title><![CDATA[416. Partition Equal Subset Sum]]></title><link>https://blog.youkuaiyun.com/hling_so/article/details/78700693</link><guid>https://blog.youkuaiyun.com/hling_so/article/details/78700693</guid><author>hling_so</author><pubDate>Sun, 03 Dec 2017 11:51:45 +0800</pubDate><description><![CDATA[题目Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note: 
Each of the array elemen]]></description><category></category></item></channel></rss>