• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ying_vincent
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页
2013年4月21日
LeetCode: Simplify Path
摘要: 改了很多次,这种麻烦的题目就是考你有没有考虑到所有情况 1 class Solution { 2 public: 3 string simplifyPath(string path) { 4 // Start typing your C/C++ solution below ... 阅读全文
posted @ 2013-04-21 04:12 ying_vincent 阅读(188) 评论(0) 推荐(0)
LeetCode: Set Matrix Zeroes
摘要: Java: 需要注意的是,题目要求不能有额外的空间,因此我们需要在矩阵上进行操作,不能直接将行和列置0,因此我们需要存储各行列的状态,但是首行首列的状态不能存在matrix[0][0]中,需要两个boolean变量来存储,而这两个boolean变量的初值则是matrix[0][0] == 0 阅读全文
posted @ 2013-04-21 03:13 ying_vincent 阅读(134) 评论(0) 推荐(0)
LeetCode: Search Insert Position
摘要: 一次过 1 class Solution { 2 public: 3 int searchInsert(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 //... 阅读全文
posted @ 2013-04-21 02:50 ying_vincent 阅读(127) 评论(0) 推荐(0)
LeetCode: Search in Rotated Sorted Array II
摘要: 搞了很久始终没通过,看了网上的简单答案,这道题的关键在于看target处于哪段递增区间里 1 class Solution { 2 public: 3 bool search(int A[], int n, int target) { 4 // Start typing yo... 阅读全文
posted @ 2013-04-21 02:47 ying_vincent 阅读(168) 评论(0) 推荐(0)
LeetCode: Search in Rotated Sorted Array
摘要: 少数次过 1 class Solution { 2 public: 3 int search(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 // DO N... 阅读全文
posted @ 2013-04-21 01:28 ying_vincent 阅读(129) 评论(0) 推荐(0)
2013年4月20日
LeetCode: Search for a Range
摘要: 一次过 1 class Solution { 2 public: 3 vector searchRange(int A[], int n, int target) { 4 // Start typing your C/C++ solution below 5 ... 阅读全文
posted @ 2013-04-20 16:41 ying_vincent 阅读(155) 评论(0) 推荐(0)
LeetCode: Search a 2D Matrix
摘要: 少数次过 1 class Solution { 2 public: 3 bool searchMatrix(vector > &matrix, int target) { 4 // Start typing your C/C++ solution below 5 ... 阅读全文
posted @ 2013-04-20 16:33 ying_vincent 阅读(137) 评论(0) 推荐(0)
LeetCode: Same Tree
摘要: 一次过 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNod... 阅读全文
posted @ 2013-04-20 15:19 ying_vincent 阅读(129) 评论(0) 推荐(0)
LeetCode: Rotate List
摘要: 两个边界条件没考虑到,少数次过 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int ... 阅读全文
posted @ 2013-04-20 15:16 ying_vincent 阅读(143) 评论(0) 推荐(0)
LeetCode: Rotate Image
摘要: 好麻烦的一道题,完全是算术。。少数次过 1 class Solution { 2 public: 3 void rotate(vector > &matrix) { 4 // Start typing your C/C++ solution below 5 /... 阅读全文
posted @ 2013-04-20 15:00 ying_vincent 阅读(214) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3