自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(95)
  • 资源 (3)
  • 收藏
  • 关注

原创 Hexo使用next主题也可以用latex啦

Hexo使用了next主题,不能使用latex公式,这可麻烦了。更换Hexo的默认的hexo-renderer-marked渲染引擎,改为hexo-renderer-kramed。在终端输入命令如下:sudo npm uninstall hexo-renderer-markedsudo npm install hexo-renderer-kramed --save开启NexT主题的M...

2018-09-16 15:55:45 3359 1

原创 367. Valid Perfect Square

    Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: ​ Do not use any built-in library function such as sqrt.Example 1:Input: 16...

2018-09-16 15:31:07 151

原创 354. Russian Doll Envelopes

    You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater tha...

2018-09-16 15:17:30 266

原创 341. Flatten Nested List Iterator

    Given a nested list of integers, implement an iterator to flatten it.    Each element is either an integer, or a list – whose elements may also be integers or other lists.Example 1:Input: [[...

2018-09-16 14:31:29 131

原创 343. Integer Break

    Given a positive integer nnn, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.Example 1:Input: 2Outp...

2018-09-16 14:09:30 80

原创 347. Top K Frequent Elements

​ Given a non-empty array of integers, return the k most frequent elements.Example 1:Input: nums = [1,1,1,2,2,3], k = 2Output: [1,2]Example 2:Input: nums = [1], k = 1Output: [1]Note:...

2018-09-16 14:08:02 104

原创 350. Intersection of Two Arrays II

​ Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2,2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Outp...

2018-09-16 14:06:20 78

原创 349. Intersection of Two Arrays

​ Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output...

2018-09-16 14:04:53 86

原创 345. Reverse Vowels of a String

​ Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Input: "hello"Output: "holle"Example 2:Input: "leetcode"Output: "leotcede"Note: ​ T...

2018-09-16 14:03:20 86

原创 338. Counting Bits

​ Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example 1:Input: 2...

2018-09-16 13:59:49 95

原创 337. House Robber III

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After a tour...

2018-09-10 15:55:28 161

原创 335. Self Crossing

You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres to the south, x[3] metres to the east and so on. ...

2018-09-10 11:36:48 273

原创 334. Increasing Triplet Subsequence

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:    Return true if there exists i, j, k     such that arr[i] &...

2018-09-10 00:58:03 120

原创 344. Reverse String

Write a function that takes a string as input and returns the string reversed.Example 1:Input: "hello"Output: "olleh"Example 2:Input: "A man, a plan, a canal: Panama"Output: "amanaP :lan...

2018-09-09 10:29:24 135

原创 332. 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 JFK. Thus, ...

2018-09-09 10:28:02 129

原创 331. Verify Preorder Serialization of a Binary Tree

One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node\’s value. If it is a null node, we record using a sentinel value such as #. ...

2018-09-09 10:25:01 97

原创 329. Longest Increasing Path in a Matrix

Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside o...

2018-09-09 10:22:53 90

原创 328. Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in p...

2018-09-06 14:14:32 157

原创 327. Count of Range Sum

Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive. Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j (i ≤ j), inc...

2018-09-06 13:32:58 124

原创 位运算小结及位运算题目小练

按位与运算 &按位与运算符”&”是双目运算符。其功能是参与运算的两数各对应的二进位相与。只有对应的两个二进位均为1时,结果位才为1,否则为0。参与运算的数以补码方式出现。 运算规则:0 & 0 = 00 & 1 = 01 & 0 = 01 & 1 = 1举例:9(00001001) &a

2018-09-05 21:09:51 853

原创 326. Power of Three,342. Power of Four

Power of ThreeGiven an integer, write a function to determine if it is a power of three.Example 1:Input: 27Output: trueExample 2:Input: 0Output: falseExample 3:_Input: 9Output: ...

2018-09-05 14:45:10 130

原创 324. Wiggle Sort II

Given an unsorted array nums, reorder it such thatnums[0] < nums[1] > nums[2] < nums[3]....Example 1:Input: nums = [1, 5, 1, 1, 6, 4]Output: One possible answer is [1, 4, 1, 5, 1

2018-09-04 23:50:53 91

原创 376. Wiggle Subsequence

A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either pos...

2018-09-01 23:16:23 96

原创 322. Coin Change

You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money ...

2018-09-01 20:18:38 82

原创 二叉树的前中后序遍历(非递归)的多种方式

前序迭代遍历前序遍历是先根后左再右,第一次接触到某个节点的时候就立即访问。栈刚开始的时候我们能接触到的只有根节点,然后我们将其值输出,然后访问它的左子女,因为我们对于一个节点只访问一次,所以我们访问完根节点之后就把根节点从栈中删除了,此时如果我们之前没有保存根节点的右子女,那么根节点右子女的信息变消失了,无法去访问,因为我们使用的是栈,后存入的先弹出,如果我们先存入左子女后存入右子...

2018-09-01 18:48:42 477

原创 321. Create Maximum Number

Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from the same ar...

2018-09-01 15:06:45 142

原创 330. Patching Array

Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Retu...

2018-09-01 13:44:35 132

原创 Hexo + GitHub Pages + NexT在win10上搭建个性化个人博客

刚刚搭好自己的个人博客,现在总结一下注册Github账号及创建仓库访问网址:https://github.com/ 注册好账号之后,点击下图中的Start Project 在Repository name中输入新建仓库的名称,如果我们只是想要在这个仓库里面放一些个人项目的话,这个名称随便取,但是我们现在是要搭建自己的个人博客,Repository name是有固定格...

2018-08-31 10:08:34 2185 2

原创 406. Queue Reconstruction by Height

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this ...

2018-08-26 12:43:43 76

原创 319. Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off ...

2018-08-26 12:28:02 120

原创 860. Lemonade Change

At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills).Each customer will only buy one lemonade a...

2018-08-26 12:00:52 148

原创 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, which is the minimum size of a coo...

2018-08-26 11:59:30 95

原创 315. Count of Smaller Numbers After Self

You are given an integer array nums and you have to return a new counts array.The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].Example:I...

2018-08-22 22:25:42 155

原创 313. Super Ugly Number

Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k.Example:Input: n = 12, primes = [2,...

2018-08-22 22:18:22 109

原创 310. Minimum Height Trees

For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called mini...

2018-08-19 18:42:06 90

原创 309. Best Time to Buy and Sell Stock with Cooldown

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 ...

2018-07-18 09:40:01 73

原创 307. Range Sum Query - Mutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val) function modifies nums by updating the element at index i to val.Example:...

2018-07-17 16:13:43 93

原创 Java.sql.Blob、byte[]、InputStream三种类型的相互转换

最近碰到了Java.sql.Blob、byte[]、InputStream三种类型的相互转换的问题,这里总结一下:一、InputStream --->  BlobHibernate提供了一个API:Hibernate.createBlob(new FileInputStream(" image/file path "));二、Blob --->  InputStream...

2018-07-17 13:41:44 6964

原创 306. Additive Number

Additive number is a string whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the s...

2018-07-17 10:46:40 86

原创 287. Find the Duplicate Number

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, fi...

2018-05-05 14:35:28 312

机器学习实战.zip

Peter Harrington著,使用Python重新实现主流机器学习算法,中英文均有

2019-07-25

apach-nutch-1.9-bin.tar.gz

用于搭建一个建议搜索引擎的工具,相比nutch2.x,nutch1.x比较稳定,并且不需要安装hbase等非关系数据库

2018-04-12

骑士周游列国回溯递归解法

在一张国际象棋棋盘上(8*8方格),骑士(knight,马)位于任意一个位置。问如何才能让骑士不重不漏的经过棋盘上的每个格?本问题中已知骑士位置(m,n),其中0=<m,n<=8,要求给出骑士行走路径,路径可用8*8矩阵输出,其中值表示骑士到达此位置行走的步数(初始为1);

2017-04-05

空空如也

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

TA关注的人

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