- 博客(21)
- 收藏
- 关注
原创 LeetCode Palindrome Partitioning
Palindrome Partitioning Total Accepted: 18645 Total Submissions: 71813My Submissions Given a string s, partition s such that every substring of the partition is a palindrome. Return all
2014-09-15 08:42:07
496
原创 LeetCode Max Points on a Line & Sort List
Max Points on a Line Total Accepted: 17476 Total Submissions: 159844My Submissions Given 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
655
原创 LeetCode LRU Cache & Insertion Sort List
LRU Cache Total Accepted: 16727 Total Submissions: 120052My Submissions Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operatio
2014-09-03 08:31:59
613
原创 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
514
原创 LeetCode Word Break II
Word Break II Total Accepted: 7703 Total Submissions: 50334My Submissions Given 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
593
原创 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
487
原创 LeetCode Single Number I & II
Single Number Total Accepted: 18499 Total Submissions: 41204My Submissions Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algor
2014-04-22 21:28:59
653
转载 Accessing VMware with PuTTY
Procedure There are 6 steps to making your VMware server accessible from anywhere Step 1 - Determine the IP address of your Virtual Machine Launch VMware server with the appropriate Virtual M
2014-04-13 09:51:09
795
转载 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
2641
原创 LeetCode Valid Number
Valid Number Total Accepted: 4830 Total Submissions: 45426My Submissions Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => fal
2014-04-02 13:38:46
1052
转载 Ubuntu 12.04安装Google Chrome
下载google chrome deb包 32位:https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb 64位:https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 注意:使用ubuntu 12.04 b
2014-03-31 12:14:19
884
原创 LeetCode Copy List with Random Pointer
Copy List with Random Pointer Total Accepted: 8155 Total Submissions: 37086My Submissions A linked list is given such that each node contains an additional random pointer which could poin
2014-03-26 14:35:37
559
原创 LeetCode Search in Rotated Sorted Array
Search in Rotated Sorted Array Total Accepted: 9935 Total Submissions: 35479 Suppose 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
509
原创 LeetCode N-Queens II
N-Queens II Total Accepted: 4907 Total Submissions: 16210My Submissions Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct
2014-03-16 17:33:46
581
原创 LeetCode N-Queens
N-Queens Total Accepted: 5516 Total Submissions: 21906My Submissions The 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
624
原创 给vim和terminal设置Solarized配色(ubuntu)
默认的黑色看久了还是觉得快瞎了,就决定配成solarized,竟然就折腾了快2个小时。。。 简单来说就是先设置terminal 再设置terminal里的vim就能轻易成功 1.先改终端的配色为Solarized 现在基本用 ubuntu 做开发,直接在终端(gnome-terminal)里面 vim,但配色效果不甚满意,因为 gvim 的配色是 Solarize
2014-03-14 19:44:56
3488
原创 LeetCode Remove Element
Remove Element Total Accepted: 9749 Total Submissions: 30209My Submissions Given 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
569
原创 LeetCode Remove Duplicates from Sorted List
Remove Duplicates from Sorted List Total Accepted: 10312 Total Submissions: 30340My Submissions Given a sorted linked list, delete all duplicates such that each element appear only once.
2014-03-06 21:53:31
469
原创 LeetCode Maximum Depth of Binary Tree
Maximum Depth of Binary Tree Total Accepted: 11728 Total Submissions: 26761My Submissions Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the
2014-03-06 21:45:07
560
原创 LeetCode Candy
Candy Total Accepted: 6750 Total Submissions: 39626My Submissions There 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
729
原创 LeetCode Sqrt(x)
Sqrt(x) Total Accepted: 8672 Total Submissions: 40362My Submissions Implement int sqrt(int x). Compute and return the square root of x. 二分时,while (l int做乘法时会溢出,虽然答案还是int。
2014-03-02 21:09:14
589
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅