• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2014年5月8日
Leetcode: Longest Common Prefix
摘要: 这道题做的不够顺利,许多次通过,但是居然是卡在一个小问题上了,判断strs是否为空,我想当然地就写成了if(strs == null) return null; 报错 java中null表示还没new出对象,就是还没开辟空间;“”表示new出了对象,但是这个对象装的是空字符串。这里显然是要应对str 阅读全文
posted @ 2014-05-08 11:56 neverlandly 阅读(318) 评论(0) 推荐(0)
Leetcode: Roman to Integer
摘要: 从右向左,preVal, curVal 1. curVal >= preVal: res+=curVal 2. curVal < preVal: res -= curVal 阅读全文
posted @ 2014-05-08 05:23 neverlandly 阅读(308) 评论(0) 推荐(0)
Leetcode: String to Integer
摘要: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文
posted @ 2014-05-08 03:27 neverlandly 阅读(388) 评论(0) 推荐(0)
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3