- 博客(112)
- 资源 (7)
- 收藏
- 关注
原创 maven3创建web工程并导入idea
开始工作确实要学很多东西,从Java基本语法到Java web框架,基本的项目、代码管理软件... ...,专业跨度还是有点大。但是既然做出选择,还是要坚持到底!过一遍Java语法,就开始学maven了,网上有很多资料了,但是还是写一点,一方面总结,一方面有助于自己的记忆。这里参考了这位同学转载的文章:http://blog.csdn.net/edward0830ly/articl
2015-01-31 00:09:53
1259
原创 LeetCode 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 vertically
2014-09-24 00:58:52
662
原创 LeetCode 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 ], [
2014-09-21 22:13:39
570
原创 LeetCode Largest Rectangle in Histogram
Largest Rectangle in Histogram Total Accepted: 16351 Total Submissions: 76441My SubmissionsGiven n non-negative integers representing the histogram's bar height where the width of each b
2014-09-18 23:54:25
614
原创 LeetCode Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu
2014-09-01 23:00:12
580
原创 LeetCode N-Queens II
Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.class Solution {public: int totalNQueens(int n) { vector ivec;
2014-08-30 23:39:02
498
原创 LeetCode Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to
2014-08-30 23:34:01
549
原创 LeetCode N-Queens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.
2014-08-30 23:03:57
483
原创 LeetCode 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.
2014-08-30 22:03:37
583
原创 LeetCode Add Binary
Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".
2014-08-28 22:42:15
558
原创 LeetCode Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", r
2014-08-28 22:06:33
482
原创 LeetCode Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va
2014-08-28 20:06:48
491
原创 LeetCode 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
2014-08-28 01:10:43
486
原创 LeetCode 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
2014-08-27 23:36:34
468
原创 LeetCode 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
2014-08-27 23:08:00
445
原创 LeetCode Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of convertin
2014-08-27 21:54:22
488
原创 LeetCode Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.参考:
2014-08-27 21:33:19
572
原创 LeetCode Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is
2014-08-26 22:13:16
515
原创 LeetCode Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the
2014-08-26 00:41:23
507
原创 LeetCode Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
2014-08-26 00:16:02
500
原创 LeetCode 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
2014-08-25 22:10:51
373
原创 Sqrt(x)
Implement int sqrt(int x).Compute and return the square root of x.class Solution {public: const double EPSILON = 1e-6; int sqrt(int x) { if (x == 0 || x == 1) return x; double
2014-08-25 22:04:51
448
原创 LeetCode Regular Expression Matching
Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st
2014-08-24 18:00:34
382
原创 LeetCode Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy t
2014-08-22 23:19:40
461
原创 LeetCode 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
2014-08-22 22:36:28
418
原创 LeetCode 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
2014-08-22 00:32:38
357
原创 LeetCode 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].
2014-08-21 22:45:48
378
原创 LeetCode Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of
2014-08-21 22:16:24
366
原创 LeetCode 4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element
2014-08-21 21:53:04
402
原创 LeetCode 3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2014-08-21 20:54:23
406
原创 LeetCode Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin
2014-08-21 17:05:07
434
原创 LeetCode Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2014-08-21 16:48:04
424
原创 LeetCode Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non
2014-08-21 15:29:35
437
原创 LeetCode Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2014-08-21 10:49:04
466
原创 Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]
2014-08-21 00:00:25
526
原创 LeetCode 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. * struct I
2014-08-20 23:19:57
451
原创 LeetCode LRU Cache
esign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if
2014-08-20 22:33:24
484
原创 Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devis
2014-08-19 00:20:25
605
MAC Protocols for Ad Hoc Wireless Networks
2012-10-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人