- 博客(21)
- 收藏
- 关注
原创 LeetCode Palindrome Partitioning
Palindrome Partitioning Total Accepted: 18645 Total Submissions: 71813My SubmissionsGiven a string s, partition s such that every substring of the partition is a palindrome.Return all
2014-09-15 08:42:07 469
原创 LeetCode Max Points on a Line & Sort List
Max Points on a Line Total Accepted: 17476 Total Submissions: 159844My SubmissionsGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.
2014-09-03 08:43:59 621
原创 LeetCode LRU Cache & Insertion Sort List
LRU Cache Total Accepted: 16727 Total Submissions: 120052My SubmissionsDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operatio
2014-09-03 08:31:59 584
原创 LeetCode Reverse Words in a String & Evaluate Reverse Polish Notation
class Solution {public: int evalRPN(vector &tokens) { int i = 0; while (i < tokens.size()) { if (isOperator(tokens[i])) { i -= 2; strin
2014-08-28 21:17:10 481
原创 LeetCode Word Break II
Word Break II Total Accepted: 7703 Total Submissions: 50334My SubmissionsGiven a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a val
2014-04-27 22:15:44 564
原创 LeetCode Rotate List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *ro
2014-04-22 21:50:00 461
原创 LeetCode Single Number I & II
Single Number Total Accepted: 18499 Total Submissions: 41204My SubmissionsGiven an array of integers, every element appears twice except for one. Find that single one.Note:Your algor
2014-04-22 21:28:59 618
转载 Accessing VMware with PuTTY
ProcedureThere are 6 steps to making your VMware server accessible from anywhereStep 1 - Determine the IP address of your Virtual MachineLaunch VMware server with the appropriate Virtual M
2014-04-13 09:51:09 760
转载 How to customize PuTTY terminal with Solarized palette
Most of us use Windows as client systems. In that case if we want to connect or ssh to Linux servers, we use Putty ( definitely there are some other tools like Cygwin, but I use Putty). The main advan
2014-04-13 09:46:43 2577
原创 LeetCode Valid Number
Valid Number Total Accepted: 4830 Total Submissions: 45426My SubmissionsValidate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => fal
2014-04-02 13:38:46 1022
转载 Ubuntu 12.04安装Google Chrome
下载google chrome deb包32位:https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb64位:https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb注意:使用ubuntu 12.04 b
2014-03-31 12:14:19 845
原创 LeetCode Copy List with Random Pointer
Copy List with Random Pointer Total Accepted: 8155 Total Submissions: 37086My SubmissionsA linked list is given such that each node contains an additional random pointer which could poin
2014-03-26 14:35:37 530
原创 LeetCode Search in Rotated Sorted Array
Search in Rotated Sorted Array Total Accepted: 9935 Total Submissions: 35479Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might becom
2014-03-16 18:40:09 480
原创 LeetCode N-Queens II
N-Queens II Total Accepted: 4907 Total Submissions: 16210My SubmissionsFollow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct
2014-03-16 17:33:46 545
原创 LeetCode N-Queens
N-Queens Total Accepted: 5516 Total Submissions: 21906My SubmissionsThe n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.
2014-03-16 10:03:43 595
原创 给vim和terminal设置Solarized配色(ubuntu)
默认的黑色看久了还是觉得快瞎了,就决定配成solarized,竟然就折腾了快2个小时。。。简单来说就是先设置terminal 再设置terminal里的vim就能轻易成功1.先改终端的配色为Solarized现在基本用 ubuntu 做开发,直接在终端(gnome-terminal)里面 vim,但配色效果不甚满意,因为 gvim 的配色是 Solarize
2014-03-14 19:44:56 3431
原创 LeetCode Remove Element
Remove Element Total Accepted: 9749 Total Submissions: 30209My SubmissionsGiven an array and a value, remove all instances of that value in place and return the new length.The order
2014-03-09 19:52:51 542
原创 LeetCode Remove Duplicates from Sorted List
Remove Duplicates from Sorted List Total Accepted: 10312 Total Submissions: 30340My SubmissionsGiven a sorted linked list, delete all duplicates such that each element appear only once.
2014-03-06 21:53:31 438
原创 LeetCode Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 11728 Total Submissions: 26761My SubmissionsGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the
2014-03-06 21:45:07 531
原创 LeetCode Candy
Candy Total Accepted: 6750 Total Submissions: 39626My SubmissionsThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children
2014-03-02 22:10:34 689
原创 LeetCode Sqrt(x)
Sqrt(x) Total Accepted: 8672 Total Submissions: 40362My SubmissionsImplement int sqrt(int x).Compute and return the square root of x.二分时,while (l int做乘法时会溢出,虽然答案还是int。
2014-03-02 21:09:14 567
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人