ltx_zero

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2019年4月21日

摘要: Num 125 验证回文串 Valid Palindrome 非常有收货的一道题嘻嘻嘻,本来是考试期间划水挑的题,坑点有点多 第一个是注意对temp1和temp2中途更新的判断 第二个是字符串频繁的作为参数出现,一次又一次的出现会爆内存,使用const string &s这样不复制(奇怪len等于0 阅读全文
posted @ 2019-04-21 23:52 ltx_zero 阅读(134) 评论(0) 推荐(0) 编辑

摘要: Num 121 买卖股票的最佳时期 Best Time to Buy and Sell Stock class Solution { public: int maxProfit(vector<int>& prices) { int len=prices.capacity(); if(prices.c 阅读全文
posted @ 2019-04-21 00:46 ltx_zero 阅读(177) 评论(0) 推荐(0) 编辑