自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

转载 JavaScript之函数与闭包

与C++不同的是,JavaScript中的函数,既可以在参数中,接收其他的函数,又可以讲函数作为返回值。当我们并不需要立刻得到一个函数的计算结果,而是根据实际需要,把函数作为返回值传递出去。function lazy_sum(arr) { var sum = function() { return arr.reduce(function(x, y) { ret

2018-03-10 19:17:20 128

原创 #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

原创 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 293

原创 补第十六周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 203

原创 补第十五周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 195

原创 补第十四周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 163

原创 补第十三周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 163

原创 补第十二周Leetcode算法博客

补第十二周Leetcode算法博客530. Minimum Absolute Difference in BSTGiven a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input:1 \

2017-12-26 19:00:55 156

原创 补第十一周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 161

原创 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 233

原创 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 248

原创 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 238

原创 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 280

原创 算法课程第六周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 196

原创 算法课程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 260

原创 算法课程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 232

原创 算法课程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 411

原创 算法课程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 406

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除