LeoEatle's World

Do have faith in what you are doing.

[LeetCode]413. Arithmetic Slices

QuestionA sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic......

[Leetcode]70 Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? 这是一道经典的动态规划题:爬梯子 解法一很多人看到这道题会第......

[LeetCode]112 Path Sum

This code need to import Treecode Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example:......

[LeetCode]121 Best time to Buy and Sell Stock

121 Best Time to Buy and Sell Stock这个问题比较经典,抽象出来就是从一个数组中找出两端之间的最大值 第一种解法可以用遍历两次的方式,第一次遍历确定卖出股票的日期,第二次遍历买入股票的日期,相减求出最大值并放入一个数组中,这个数组所保存的就是每天卖出可以获得的最大利益,最后再求出这个数组的最大值但是,这样嵌套循环的结果是O(n2) 第二种解法我们可以只遍历一次......

令人伤心的博客碎片

“纪念我逝去的”

怅然若失,其实也不是,因为已经失去了。 就在昨天我想久违地登陆以下我的博客的时候,我发现又奇妙地登不上了,其实第一反应也是我很久没有给腾讯云续费了,一直收到它的短信但很自然地觉得是广告然后就无视掉。登上腾讯云一看,惊了,云服务器界面显示我一台服务器都没有,都没有,我翻了半天这破管理界面,连回收站都没有。 我这才登陆了我很久没登录的QQ邮箱,发现它已经把我的服务器回收了,而且因为已经超过了7天......

The inherit in javascript

读红宝书有感

/** * Created by leoeatle on 16/9/2. */function Person(name){ this.name = name; this.age = 20;}Person.prototype.walk = function () { console.log(this.name + " is walkin......

A intresting jquery code

今天在codepen看到了一个短小精悍的js特效jQuery(document).ready(function(){ $('h1').mousemove(function(e){ var rXP = (e.pageX - this.offsetLeft-$(this).width()/2); var rYP = (e.pageY - this.offs......

Hello Hexo

"This is a kind of life"

“新博客第一篇!” 前言其实最近真的很忙,竟然每周五晚上公司都会断网,真是未解之谜,只好来写博客了。 来上海银联已经三个礼拜了,想起刚来上海四处找房子的那几天累到吐血,还是觉得特别魔幻。上海其实真的,毕竟魔都,压力挺大的,我现在住在浦东的东边的东边,但周围很多都是在陆家嘴上班的,每天早晨7、8点就可以看到大家从四面八方拥到地铁站,手上提着包子馒头,街边其实都是卖早餐的,然后挤地铁坐半小时......