学习日记
文章平均质量分 59
Yvan_Pierce
这个作者很懒,什么都没留下…
展开
-
#Leetcode算法博客
Leetcode算法博客455. Assign Cookies(贪心算法)Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi原创 2018-01-13 23:35:58 · 184 阅读 · 0 评论 -
补第十六周Leetcode算法博客
补第十六周Leetcode算法博客121. Best Time to Buy and Sell StockSay 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 transactio原创 2017-12-28 19:43:42 · 206 阅读 · 0 评论 -
补第十五周leetcode算法博客
补第十五周leetcode算法博客100. Same TreeGiven 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 ha原创 2017-12-28 01:55:59 · 196 阅读 · 0 评论 -
补第十四周Leetcode算法博客
补第十四周Leetcode算法博客739. Daily TemperaturesGiven a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature. If原创 2017-12-28 00:53:21 · 168 阅读 · 0 评论 -
补第十三周Leetcode算法博客
补第十三周Leetcode算法博客746. Min Cost Climbing StairsOn a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You nee原创 2017-12-26 20:20:20 · 165 阅读 · 0 评论 -
NP完全问题 8.9
8.9. In the Hitting Set Problem, we are given a family of sets {S1,S2,…,Sn), and a budget b, and we wish to find a set H of size <= b which intersects every Si,if such an H exists ,In other words, we w原创 2018-01-01 20:39:19 · 300 阅读 · 0 评论 -
补第十一周Leetcode 博客
补第十一周Leetcode 博客389.Find the DifferenceGiven two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random posi原创 2017-12-23 16:21:24 · 163 阅读 · 0 评论 -
Leetcode算法课程第九周(补)
Leetcode算法课程第九周(补)292. Nim Game题目描述You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who原创 2017-11-06 13:12:49 · 256 阅读 · 0 评论 -
Leetcode算法课程第八周(补)
Leetcode算法课程第八周(补)412. Fizz Buzz题目描述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 mu原创 2017-11-06 12:46:08 · 240 阅读 · 0 评论 -
leetcode算法课程第十周博客
leetcode算法课程第十周博客575. Distribute CandiesGiven an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the correspon原创 2017-11-13 00:04:17 · 234 阅读 · 0 评论 -
算法课程第六周Leetcode作业
算法课程第六周Leetcode作业题目:53. Maximum Subarray题目描述Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],原创 2017-10-15 20:25:12 · 197 阅读 · 0 评论 -
Leetcode算法课程第七周作业
Leetcode算法课程第七周作业13. Roman to Integer题目描述:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.给定一个罗马数字,把它转变成一个整型,罗马数字的范围在1到3999题目分析首先罗马数字有7个符号 I —原创 2017-10-22 21:49:25 · 283 阅读 · 0 评论 -
算法课程Leetcode作业第四周技术博客
算法课程Leetcode作业第四周技术博客题目:617. Merge Two Binary Trees题目描述:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others原创 2017-10-01 03:11:03 · 266 阅读 · 0 评论 -
算法课程Leetcode作业第二周技术博客
算法课程Leetcode作业第二周技术博客题目:3. Longest Substring Without Repeating Characters 难度:medium题目描述Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, t原创 2017-09-17 17:57:47 · 412 阅读 · 0 评论 -
算法课程Leetcode作业第一周技术博客
算法课程Leetcode作业第一周技术博客第一周的作业先尝试下easy难度试试水题目:No.1 Two Sum概述Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would ha原创 2017-09-10 20:33:26 · 408 阅读 · 0 评论 -
算法课程Leetcode作业第三周技术博客
算法课程Leetcode作业第三周技术博客题目:2. Add Two Numbers 难度:medium题目描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes c原创 2017-09-25 00:50:29 · 233 阅读 · 0 评论 -
JavaScript之函数与闭包
与C++不同的是,JavaScript中的函数,既可以在参数中,接收其他的函数,又可以讲函数作为返回值。当我们并不需要立刻得到一个函数的计算结果,而是根据实际需要,把函数作为返回值传递出去。function lazy_sum(arr) { var sum = function() { return arr.reduce(function(x, y) { ret转载 2018-03-10 19:17:20 · 130 阅读 · 0 评论