码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
【leetcode】Convert Sorted List to Binary Search Tree-递
我觉着写得比看到的答案更清晰~ class Solution { public: TreeNode *ltob(ListNode *head, ListNode *end) { if(head == end) { TreeNode * node = new TreeNode(head->val); return node;...
分类:其他好文   时间:2014-09-09 12:56:58    阅读次数:166
LeetCode--Wrod Break
---恢复内容开始--- 1 class Solution { 2 public: 3 bool wordBreak(string s, unordered_set &dict) { 4 int nsize=s.size(); 5 int i=0,j=0; 6...
分类:其他好文   时间:2014-09-09 11:37:18    阅读次数:242
LeetCode--Largest Rectangle in Histogram
---恢复内容开始--- 1 class Solution { 2 public: 3 int largestRectangleArea(vector &height) { 4 int n = height.size(); 5 if(n == 0) 6 ...
分类:其他好文   时间:2014-09-09 11:27:28    阅读次数:217
Solution for When browse http://xxx/ReportServer Show Error (rsAccessDenied)
Issue:Reporting Services ErrorThe permissions granted to user 'IDEAAM\William' are insufficient for performing this operation. (rsAccessDenied) Get On...
分类:数据库   时间:2014-09-09 11:22:48    阅读次数:264
[LeetCode] Linked List Cycle II
public class Solution { public ListNode detectCycle(ListNode head) { ListNode slow = head; ListNode fast = head; boolean hasCy...
分类:其他好文   时间:2014-09-09 11:13:48    阅读次数:204
[LeetCode] Set Matrix Zeros
1 public class Solution { 2 public void setZeroes(int[][] matrix) { 3 int m=matrix.length; 4 int n=matrix[0].length; 5 bo...
分类:其他好文   时间:2014-09-09 10:38:48    阅读次数:203
[LeetCode] Spiral Matrix II
1 public class Solution { 2 public int[][] generateMatrix(int n) { 3 int num=1; 4 int [][] result = new int[n][n]; 5 6 ...
分类:其他好文   时间:2014-09-09 10:27:58    阅读次数:206
【leetcode】Remove Duplicates from Sorted List II-很精简
觉着自己写的比看到的答案精简,分享一下: class Solution { public: ListNode *deleteDuplicates(ListNode *head) { if(head == NULL) return NULL; ListNode res(-1); ListNode* pre = &res; pr...
分类:其他好文   时间:2014-09-08 01:03:16    阅读次数:267
[LeetCode] Best Time to Buy and Sell Stock
1 public class Solution { 2 public int maxProfit(int[] prices) { 3 if (prices.length prices[i]) buyPrices = prices[i];11 }12 ...
分类:其他好文   时间:2014-09-08 01:00:16    阅读次数:200
[LeetCode] Search a 2D Matrix
public class Solution { public boolean searchMatrix(int[][] matrix, int target) { int low=0, high=matrix.length-1; while (low target)...
分类:其他好文   时间:2014-09-08 00:58:06    阅读次数:347
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!