原创 【leetcode】Set Matrix Zeroes

class Solution { public: void setZeroes(vector<vector<int> > &matrix) { // Note: The Solution object is ins

原创 【leetcode】Binary Tree Level Order Traversal II

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right;

原创 【leetcode】Construct Binary Tree from Inorder and Postorder Traversal

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right;

原创 wordnet學習記錄

  人們經常區分詞語知識和世界知識。前者體現在詞典中,後者體現在百科全書中。事實上二者的界限是模糊的。比如hit(“打”)某人是一種帶有敵意的行爲,這是百科知識;而hit跟strike(“擊”)多多少少同義,並且hit可以帶一個直接賓語論

原创 【leetcode】Roman to Integer

class Solution { public: int romanToInt(string s) { // Note: The Solution object is instantiated only once

原创 【leetcode】Remove Duplicates from Sorted Array

class Solution { public: int removeDuplicates(int A[], int n) { // Note: The Solution object is instantiate

原创 【leetcode】Next Permutation

class Solution { public: void nextPermutation(vector<int> &num) { // Note: The Solution object is instantia

原创 learning to rank資料彙總

如何理解 Learning to rank http://hi.baidu.com/nuumkxjinrbacgd/item/9b8ea4f44126e9723d198b1e Learning to Rank小結 http://b

原创 【leetcode】Binary Tree Level Order Traversal

/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right;

原创 【leetcode】Plus One

class Solution { public: vector<int> plusOne(vector<int> &digits) { // Note: The Solution object is instant

原创 【leetcode】Remove Duplicates from Sorted Array II

class Solution { public: int removeDuplicates(int A[], int n) { // Start typing your C/C++ solution below

原创 【leetcode】3Sum Closest

class Solution { public: int threeSumClosest(vector<int> &num, int target) { // Note: The Solution object i

原创 【leetcode】Add Binary

class Solution { public: string addBinary(string a, string b) { // Note: The Solution object is instantiate

原创 【leetcode】Valid Palindrome

class Solution { public: bool check1(char ch)//當ch在'a'-'z'之間時,返回true { if(ch>='a'&&ch<='z')

原创 【leetcode】Search in Rotated Sorted Array II

class Solution { public: bool search(int A[], int n, int target) { // Note: The Solution object is instanti