北海的博客

心若北海-以容鲲鹏

autoreconf 命令

在linux中通过拷贝文件安装软件,执行make 操作时出现如下问题 Makefile:372: recipe for target 'aclocal.m4' failed 解决办法:在linux终端下执行 :autoreconf -vfi 通...

2017-09-19 16:21:30

阅读数:360

评论数:0

95. Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program shou...

2017-09-18 20:12:15

阅读数:220

评论数:0

63. Unique Paths II

Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacl...

2017-09-18 10:15:33

阅读数:285

评论数:0

264. Ugly Number II

Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, ...

2017-09-14 21:41:55

阅读数:55

评论数:0

368. Largest Divisible Subset

Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = ...

2017-09-14 20:35:58

阅读数:75

评论数:0

120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given th...

2017-09-13 22:12:15

阅读数:51

评论数:0

213. House Robber II

Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so t...

2017-09-13 20:24:15

阅读数:213

评论数:0

c中struct和unsigned char*强制互相转化。

今天看c代码的时候发现一个struct强制转换成char*的,然后在自己的sublime上怎么都会报错,即使没有报错,但是运行时也会奔溃。 无奈使用牛逼烘烘的vs2017!! 果然可以了,试了几个不同的操作。 可以看到str转变后地址发生了变化,对str指向的对象操作的时候,结构体的数据也发生...

2017-09-13 18:32:30

阅读数:195

评论数:0

vim记住上次打开位置

使用了centos7,换了几次配置文件后,vim竟然不能自动记住文件上次打开了。 查了好多种方法就这个搞定了问题。 在配置文件.vimrc或/etc/vimrc中加入下面两行。 set viminfo='10,\"100,:20,%,n~/.viminfo  au BufRead...

2017-09-13 15:06:11

阅读数:681

评论数:0

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

2017-09-12 20:10:34

阅读数:82

评论数:0

279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n...

2017-09-12 17:37:25

阅读数:103

评论数:0

300. Longest Increasing Subsequence

Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The lon...

2017-09-11 22:36:00

阅读数:65

评论数:0

64. Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path....

2017-09-11 21:44:45

阅读数:87

评论数:0

416. Partition Equal Subset Sum

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in b...

2017-09-10 16:17:05

阅读数:132

评论数:1

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

2017-09-10 13:47:11

阅读数:114

评论数:0

使我对动态规划的理解发生转折的算法的解决过程的思想变化的过程

事情发生在今天这个夜黑风高的夜晚。 我遇到一道题目 62. Unique Paths A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The r...

2017-09-09 00:46:45

阅读数:107

评论数:0

638. Shopping Offers

In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are some special offers, and a special offer consi...

2017-09-07 23:36:53

阅读数:68

评论数:0

650. 2 Keys Keyboard

Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: Copy All: You can copy all t...

2017-09-06 18:47:08

阅读数:64

评论数:0

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

2017-09-05 23:01:55

阅读数:64

评论数:0

647. Palindromic Substrings

647. Palindromic Substrings Given a string, your task is to count how many palindromic substrings in this string. The substrings with differe...

2017-09-05 21:57:48

阅读数:60

评论数:0

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