• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅
2015年1月27日
Leetcode: Two Sum III - Data structure design
摘要: The trade off should be considered: In fact, there has to be one operation's time complexity is O(n) and the other is O(1), no matter add or find. So 阅读全文
posted @ 2015-01-27 12:51 neverlandly 阅读(3524) 评论(0) 推荐(0)
Leetcode: Two Sum II
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function ... 阅读全文
posted @ 2015-01-27 12:02 neverlandly 阅读(400) 评论(0) 推荐(0)
Leetcode: Fraction to Recurring Decimal
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2015-01-27 09:10 neverlandly 阅读(391) 评论(0) 推荐(0)
Leetcode: Compare Version Numbers
摘要: 这道题的意思用一个例子说明就是1.2 < 1.10, 因为1.10跟1.1是不一样的,1.10代表tenth revision. 而1.1代表first revision。所以这道题要按“.”分段,然后分段比较,方法是用split函数把string 分段,每一段挨个比过去。这里参考了网上的一个小技巧 阅读全文
posted @ 2015-01-27 05:09 neverlandly 阅读(461) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3