自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(108)
  • 资源 (2)
  • 收藏
  • 关注

原创 Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of

2015-07-31 21:23:54 254

原创 Maximal Rectangle

Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.在一个M * N的矩阵中,所有的元素只有0和1, 找出只包含1的最大矩形。例如:图中是一个4 × 6的矩形,画出红色的是我们要找到的区域。

2015-07-31 20:28:02 268

原创 Largest Rectangle in Histogram

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of

2015-07-31 14:45:18 329

原创 Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1-

2015-07-31 10:36:42 321

原创 Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.public class Solution {

2015-07-31 10:21:01 258

原创 Word Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertic

2015-07-31 08:51:05 352

原创 Subsets II

Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplic

2015-07-30 20:55:46 241

原创 Subsets

Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For example,

2015-07-30 20:53:38 243

原创 Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers

2015-07-30 13:10:08 320

原创 Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrixhas the following properties:Integers in each row are sorted from left to right.The first integer of each ro

2015-07-30 10:10:50 232

原创 Set Matrix Zeroes

Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.可以申请长度为m和n的两个数组,存储index=0的位置,然后将对应的行,列置为0。public void setZeroes(int[][] matrix) { ArrayList ht=new

2015-07-30 09:34:46 259

原创 Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:

2015-07-29 21:46:32 246

原创 Simplify Path

Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"这是一道简化路径的题,路径简化的依据是:当遇到“/../"则需要返回上级目录,需检查上级目录是否为空。当遇到

2015-07-29 20:37:08 213

原创 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?这是一个简单的Fibonaci问题,只是前三个元素应为0,1

2015-07-29 14:46:56 236

原创 Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x.顺序实现会造成超时,可以对半搜索。public int mySqrt(int x) { long s=0;long e=x; while(e>=s){ long mid=s+(e-s)/2; if(x<mid*mid) e=mid-1;

2015-07-29 13:24:21 245

原创 Text Justification

Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You should pack your words in a greedy approach; that i

2015-07-28 21:26:29 272

原创 Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"  b = "1"Return "100".public class Solution { public String addBinary(String a, String b) {

2015-07-28 14:52:05 267

原创 Plus One

Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.只有当是9时,加1才会进位,否则返回即可。如果一

2015-07-28 14:17:52 243

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

2015-07-28 13:37:12 268

原创 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.Note: You can only move either down or right at

2015-07-28 10:12:10 248

原创 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 obstacle and empty space is marked as 1 and 0 respectively in the grid

2015-07-28 09:19:32 220

原创 Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the

2015-07-28 08:58:14 221

原创 Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.public class Solution { public st

2015-07-27 21:31:45 246

原创 Permutation Sequence

The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312""32

2015-07-27 20:51:48 256

原创 Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is def

2015-07-27 14:25:47 220

原创 Insert Interval

Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Exa

2015-07-27 14:16:34 305

原创 Merge Intervals

Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]./** * Definition for an interval. * public class Int

2015-07-26 10:53:00 218

原创 Spiral Matrix II

Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix:[[ 1, 2, 3 ], [ 8, 9, 4 ], [

2015-07-25 20:28:07 219

原创 Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[[ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You

2015-07-25 20:21:32 259

原创 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],the contiguous subarray [4,−1,2,1] ha

2015-07-25 18:57:20 202

原创 N-Queens II

Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.对于一个4皇后问题,声明一个长度为4的数组(因为行数为4)。usedColumns[] = [1,0,2,3]表达含义是:当前4个

2015-07-25 15:14:08 222

原创 Pow(x, n)

Implement pow(x, n).一个数的32次方,只要知道16次方再求平方即可,依次类推,只要五次乘法:先求平方,再求4次方,8次方,16次方,32次方。奇数则乘以x。public class Solution { public double myPow(double x, int n) { if(n<0) return 1/power(

2015-07-25 13:49:05 291

原创 Anagrams

Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.题目的意思是说字符串数组中由相同字母组成但字母顺序不同的字符串的集合。如“abc”和“bac”。将字符串转换为字符数组排序,再转换为字符串。使用map的key

2015-07-25 10:36:17 170

原创 Rotate Image

You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).public static void rotate(int[][] matrix) { int len=matrix.length; int[][] t=new int[len][len];

2015-07-24 21:23:59 265

原创 Permutations II

Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].这个

2015-07-24 20:55:12 279

原创 Permutations

Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].利用递归的方法,从头开始遍历。pu

2015-07-24 16:13:38 189

原创 Jump Game II

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.Your goal is to

2015-07-24 14:46:18 245

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

2015-07-24 10:44:36 223

原创 Wildcard Matching

'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string (not partial).The function prototype shou

2015-07-24 09:36:52 349

原创 Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.题目就是模拟非负大数乘法。乘法和加法都会产生进位,用一个数组保存逐位乘法的结果

2015-07-23 21:42:05 245

Selenium2 Python自动化测试实战(有13,14章)

《selenium2 python 自动化测试实战(第二版)》 虫师

2017-12-21

计算机复习提纲

南邮计算机网络的复习提纲

2013-12-19

空空如也

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

TA关注的人

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