• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ying_vincent
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年4月2日
LeetCode: Longest Consecutive Sequence
摘要: 想到map了,可惜没想到用erase来节省空间,看了网上答案 1 class Solution { 2 public: 3 int longestConsecutive(vector &num) { 4 // Start typing your C/C++ solution ... 阅读全文
posted @ 2013-04-02 17:27 ying_vincent 阅读(232) 评论(0) 推荐(0)
LeetCode: Longest Common Prefix
摘要: string.erase没掌握好,悲了个剧,2次过 1 class Solution { 2 public: 3 string longestCommonPrefix(vector &strs) { 4 // Start typing your C/C++ solution ... 阅读全文
posted @ 2013-04-02 15:56 ying_vincent 阅读(213) 评论(0) 推荐(0)
LeetCode: "Letter Combinations of a Phone Number
摘要: 一些小问题, “”的输出我的是[], 但是答案却是[""], 比较难理解,3次过 1 class Solution { 2 public: 3 void dfs(vector &ret, string tmp, map refer, string digits, int beg) { 4 ... 阅读全文
posted @ 2013-04-02 15:44 ying_vincent 阅读(175) 评论(0) 推荐(0)
LeetCode: Length of Last Word
摘要: 初始length的时候忘给了0了,2次过 1 class Solution { 2 public: 3 int lengthOfLastWord(const char *s) { 4 // Start typing your C/C++ solution below 5 ... 阅读全文
posted @ 2013-04-02 15:19 ying_vincent 阅读(156) 评论(0) 推荐(0)
LeetCode: Largest Rectangle in Histogram
摘要: 没想出来,看了网上答案再改了改 1 class Solution { 2 public: 3 struct node { 4 int left; 5 int right; 6 }; 7 int largestRectangleArea(vect... 阅读全文
posted @ 2013-04-02 05:11 ying_vincent 阅读(242) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3