- 博客(124)
- 收藏
- 关注
原创 dddd
MapService_MapServer mapservice = new MapService_MapServer();mapservice.Url = “http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/”;MapServerInfo mapi
2014-01-16 23:46:12 791
原创 LeetCode-Word Ladder
class Solution {public: int ladderLength(string start, string end, unordered_set &dict) { // Start typing your C/C++ solution below // DO NOT write int main() function uno
2013-08-22 21:14:02 641
原创 LeetCode-Palindrome Partitioning II
class Solution {public: int minCut(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function if (s.size() == 0) { retur
2013-08-22 16:34:49 527
原创 LeetCode-Palindrome Partitioning
class Solution {public: vector> partition(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function vector > sets; vector > F(s.siz
2013-08-22 12:52:13 532
原创 LeetCode-Populating Next Right Pointers in Each Node
/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeLinkNode(int x) : val(x), left(NULL), right(NULL), next(N
2013-08-21 20:28:44 439
原创 LeetCode-Longest Consecutive Sequence
class Solution {public: int longestConsecutive(vector &num) { // Start typing your C/C++ solution below // DO NOT write int main() function int maxLen = 0; m
2013-08-21 19:58:41 444
原创 LeetCode-Surrounded Regions
class Solution {public: void solve(vector> &board) { // Start typing your C/C++ solution below // DO NOT write int main() function if (board.size() == 0 || board[0].s
2013-08-21 19:56:35 445
原创 LeetCode-Distinct Subsequences
递归:只能过小数据class Solution {public: int numDistinct(string S, string T) { // Start typing your C/C++ solution below // DO NOT write int main() function int cnt = 0;
2013-08-20 19:12:57 420
原创 Subsets II
class Solution {public: vector > subsetsWithDup(vector &S) { // Start typing your C/C++ solution below // DO NOT write int main() function sort(S.begin(), S.end());
2013-08-20 18:02:50 402
原创 LeetCode-Word Search
class Solution {public: bool exist(vector > &board, string word) { // Start typing your C/C++ solution below // DO NOT write int main() function if (word == "") {
2013-08-20 10:20:30 448
原创 LeetCode-Wildcard Matching
class Solution {public: bool isMatch(const char *s, const char *p) { // Start typing your C/C++ solution below // DO NOT write int main() function if (*s == '\0' && *p ==
2013-08-19 20:17:42 454
原创 LeetCode-Combination Sum II
class Solution {public: vector > combinationSum2(vector &num, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function sort(num.beg
2013-08-19 16:23:58 459
原创 LeetCode-Combination Sum
class Solution {public: vector > combinationSum(vector &candidates, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function sort(c
2013-08-19 13:40:24 396
原创 LeetCode-Sudoku Solver
class Solution {public: void solveSudoku(vector > &board) { // Start typing your C/C++ solution below // DO NOT write int main() function solveSudoku1(board); }
2013-08-18 21:55:46 482
原创 LeetCode-Valid Sudoku
class Solution {public: bool isValidSudoku(vector > &board) { // Start typing your C/C++ solution below // DO NOT write int main() function bool ans = true; const
2013-08-18 20:50:28 395
原创 LeetCode-Substring with Concatenation of All Words
class Solution {public: vector findSubstring(string S, vector &L) { // Start typing your C/C++ solution below // DO NOT write int main() function vector ans;
2013-08-18 15:50:16 465
原创 LeetCode-Anagrams
class Solution {public: vector anagrams(vector &strs) { // Start typing your C/C++ solution below // DO NOT write int main() function vector ans; vector > dics;
2013-08-18 13:25:54 451
原创 LeetCode-Search in Rotated Sorted Array II
class Solution {public: bool search(int A[], int n, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function bool isFound = false;
2013-08-18 11:36:32 417
原创 LeetCode-Maximal Rectangle
class Solution {public: int maximalRectangle(vector > &matrix) { // Start typing your C/C++ solution below // DO NOT write int main() function if (matrix.size() == 0 || ma
2013-08-17 16:55:25 510
原创 LeetCode-Best Time to Buy and Sell Stock III
class Solution {public: int maxProfit(vector &prices) { // Start typing your C/C++ solution below // DO NOT write int main() function int maxPrft = 0; if (prices.
2013-08-17 15:59:49 548
原创 LeetCode-Best Time to Buy and Sell Stock II
class Solution {public: int maxProfit(vector &prices) { // Start typing your C/C++ solution below // DO NOT write int main() function int maxPrft = 0; bool flag =
2013-08-17 15:03:10 561
原创 LeetCode-Best Time to Buy and Sell Stock
class Solution {public: int maxProfit(vector &prices) { // Start typing your C/C++ solution below // DO NOT write int main() function int maxPrft = 0; if (prices.s
2013-08-17 14:36:22 585
原创 LeetCode-Sum Root to Leaf Numbers
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-17 13:13:49 412
原创 LeetCode-Valid Palindrome
class Solution {public: bool isPalindrome(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function bool ans = true; int beg = 0;
2013-08-16 20:36:59 391
原创 LeetCode-Binary Tree Maximum Path Sum
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 20:17:57 371
原创 LeetCode-Triangle
class Solution {public: int minimumTotal(vector > &triangle) { // Start typing your C/C++ solution below // DO NOT write int main() function if (triangle.size() == 0 || tr
2013-08-16 18:41:40 402
原创 LeetCode-Pascal's Triangle II
class Solution {public: vector getRow(int rowIndex) { // Start typing your C/C++ solution below // DO NOT write int main() function vector ans(rowIndex + 1, 0); an
2013-08-16 18:05:13 399
原创 LeetCode-Pascal's Triangle
class Solution {public: vector > generate(int numRows) { // Start typing your C/C++ solution below // DO NOT write int main() function vector > ans; vector pre;
2013-08-16 16:46:35 368
原创 LeetCode-Flatten Binary Tree to Linked List
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 16:19:29 413
原创 LeetCode-Path Sum II
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 15:51:50 439
原创 LeetCode-Path Sum
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 14:57:28 372
原创 LeetCode-Minimum Depth of Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 12:35:42 372
原创 LeetCode-Balanced Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-16 11:27:30 406
原创 LeetCode-Convert Sorted List to Binary Search Tree
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *//** * Definition for binary tree * stru
2013-08-15 21:00:25 351
原创 LeetCode-Convert Sorted Array to Binary Search Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-15 20:51:10 372
原创 LeetCode-Scramble String
class Solution {public: bool isScramble(string s1, string s2) { // Start typing your C/C++ solution below // DO NOT write int main() function //f[len][i][j]表示长度为len的以s1[i]
2013-08-15 20:43:38 502
原创 LeetCode-Gray Code
class Solution {public: vector grayCode(int n) { // Start typing your C/C++ solution below // DO NOT write int main() function int size = 1 << n; vector ans;
2013-08-15 19:44:46 462
原创 LeetCode-Unique Binary Search Trees II
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-15 16:47:11 344
原创 LeetCode-Recover Binary Search Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-15 16:30:56 433
原创 LeetCode-Binary Tree Level Order Traversal II
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */class Soluti
2013-08-15 16:20:17 383
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人