自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Vuejs+vue-router打包+Nginx配置

其实这个网上已经有了很多人写了,为什么我还要再写这一篇博客?因为我亲身把他们生产的坑给踩了个通透(摊手。正文开始本次的项目是基于vue-cli生成的项目,采用的vue-router的history模式。到这里相信大部人还是类似了,接下来就是一个坑死人不偿命的网上诸多博客都在采用的巨坑。 在进行打包的时候,很多博客里都写了,将/config/index.js下,build中的assetsPublic

2018-05-09 15:11:28 9510 1

原创 Maximum Length of Pair Chain

问题来源问题描述You are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c, d) can follow another pair (a, b) if and only if b < c. Chai

2018-01-10 15:41:53 427

原创 Course Schedule II

问题来源问题描述There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as

2018-01-03 14:55:19 416

原创 KITE Problem

问题来源: 算法概论课后习题8.19问题描述A kite is a graph on an even number of vertices, say 2n, in which n of the vertices form a clique and the remaining n vertices are connected in a “tail” that consists of a path jo

2018-01-01 20:49:41 684 1

原创 Delete and Earn

问题来源问题描述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

2017-12-20 16:16:42 364

原创 Jump Game

问题来源问题描述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.Determine if

2017-12-15 17:27:32 362

原创 Clone Graph

问题来源问题描述Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization: Nodes are labeled uniquely.We use # as a separator for each

2017-12-15 17:08:46 344

原创 Friend Circles

问题来源问题描述There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C

2017-12-15 16:48:19 387

原创 Target Sum

问题来源问题描述You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.Find out ho

2017-11-29 16:27:53 374

原创 K Inverse Pairs Array

问题来源问题描述Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs.We define an inverse pair as following: For ith and jth ele

2017-11-22 21:07:45 436

原创 Maximum Length of Repeated Subarray

问题来源问题描述Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example 1:Input:A: [1,2,3,2,1]B: [3,2,1,4,7]Output: 3Explanation: The repeated subarr

2017-11-11 10:57:03 405

原创 Longest Consecutive Sequence

问题来源问题描述Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2

2017-11-10 22:50:42 368

原创 Candy

问题来源问题描述There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on

2017-11-01 16:53:21 477

原创 Golang:Cobra安装与使用

引子最近在做一个基于Golang的CLI程序,索性便将自己探索出来的经验写下与诸位分享,如果更好的方法也希望大家能告知,共同进步Cobra安装大部分教程都是直接告诉我们,我们只需要在有go的环境下,输入$ go get -v github.com/spf13/cobra/cobra便可以顺顺利利的安装。然而,现实与理想还是有差距的。许多同学都因为某些被墙的链接而停在了某一步骤。解决方法当然是有的。

2017-11-01 11:31:52 5191 3

原创 Valid Number

问题来源问题描述Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to be ambiguous. You s

2017-10-18 15:05:35 456

原创 Golang: 使用flag包进行命令行参数解析

最近在使用go开发cli(command-line-interface)时,通过对于官方文档以及他人博客的学习,在此写下个人认为更适合自己往后回顾的关于flag的使用说明。工欲善其事必先利其器,先奉上flag官方文档解析Demo0:package mainimport ( "fmt" "flag")func main() { t1 := flag.Int("w",0,"

2017-10-16 23:05:40 3923

原创 Redundant Connection II

Redundant Connection

2017-10-11 16:40:55 579

原创 Evaluate Division

问题来源问题描述Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the a

2017-10-05 11:00:17 401

原创 Ubuntu14.04 Golang环境配置

最近开始学习golang,便顺手记录下本人在ubuntu环境下的安装golang的历程。说在前头网络上关于golang的配置(Ubuntu下,以下如未指明都是在ubuntu14.04的环境下进行),总体上而言有两种,一种是去官网下载tar.gz包进行解压安装,我最开始也是这样,然而安装完成后在安装第三方包时发现总是报错找不到 runtime/trace,不知道是因为本人使用的是windows下的ba

2017-09-28 21:27:42 1495

原创 Reconstruct Itinerary

问题来源问题描述Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from J

2017-09-26 20:19:36 469

原创 Course Schedule

There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as

2017-09-22 21:14:37 226

原创 Merge k sorted List

问题来源: 问题描述合并k条有序链表。问题分析实际上,我们只需要把这个问题简化为n次两条有序链表的合并,一切就会迎刃而解。真正困难的部分也就是链表归并的代码。两路有序链表归并的思路也不复杂,就是不断的将两条链表中小的元素取出(按照升序)组成一条新的链表。解决代码/** * Definition for singly-linked list. * struct ListNode { *

2017-09-18 18:30:40 599

原创 寻找第K大的数字

寻找第K大的数字问题来源: leetcode问题从一个乱序的数组中找出第K大的数字分析实际上,第一眼看到这种题目,我们最容易想到的就是使用排序。将数组排好序后你想要哪个第k大还不是一句话的事情。不过排序虽然是一种可行的方法,但显然其效率不高。实际上,所谓排序也就是一个数一个数的排好序,这里的一个数一个数显然是一个很重要的提示。以冒泡排序为例,实际过程也就是将每个‘泡’逐一地浮起。那在这里我们可以只浮

2017-09-11 16:28:13 623

原创 7思妙想之Js 实现for循环中的停顿

7思妙想之js 实现for循环中的停顿与朋友在实现一次的web端的展示时,遇到了一个问题。先贴出有问题的代码:for(var i = 0; i < length; i++) { // codes settimeout(event, time); // 此处执行符合条件的动画或者事件}我们的构想是,代码在遇见settimeout时, 能够等待settimeout执行完,再继续执

2016-10-19 14:09:11 861

空空如也

空空如也

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

TA关注的人

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