- 博客(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
784
原创 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
634
原创 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
519
原创 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
529
原创 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
434
原创 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
439
原创 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
440
原创 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
414
原创 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
399
原创 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
444
原创 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
456
原创 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
393
原创 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
481
原创 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
392
原创 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
455
原创 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
415
原创 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
509
原创 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
543
原创 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
584
原创 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
411
原创 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
388
原创 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
370
原创 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
401
原创 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
398
原创 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
364
原创 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
408
原创 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
438
原创 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
369
原创 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
369
原创 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
405
原创 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
347
原创 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
370
原创 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
492
原创 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
459
原创 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
343
原创 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
427
原创 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
382
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人