• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  Lintcode

上一页 1 2 3 4
Lintcode: Hash Function && Summary: Modular Multiplication, Addition, Power && Summary: 长整形long

摘要:In data structure Hash, hash function is used to convert a string(or any other type) into an integer smaller than hash size and bigger or equal to zer... 阅读全文
posted @ 2015-02-07 07:06 neverlandly 阅读(1765) 评论(1) 推荐(0)
Lintcode: Fizz Buzz

摘要:StringBuffer的用法,append方法的参数可以使boolean, char, char[], CharSequence, double, float, int, long, String, StringBuffer Better way: http://www.cnblogs.com/E 阅读全文
posted @ 2015-02-07 03:22 neverlandly 阅读(729) 评论(0) 推荐(0)
Lintcode: First Bad Version

摘要:The code base version is an integer and start from 1 to n. One day, someone commit a bad version in the code case, so it caused itself and the followi... 阅读全文
posted @ 2015-02-07 03:02 neverlandly 阅读(458) 评论(0) 推荐(0)
Lintcode: Find Peak Element

摘要:There is an integer array which has the following features: * The numbers in adjacent positions are different. * A[0] A[A.length - 1].We define... 阅读全文
posted @ 2015-02-06 13:21 neverlandly 阅读(346) 评论(0) 推荐(0)
Lintcode: Fast Power

摘要:Calculate the a^n % b where a, b and n are all 32bit integers.ExampleFor 2^31 % 3 = 2For 100^1000 % 1000 = 0ChallengeO(logn)这道题跟Pow这道题很像数学问题,要求O(log n... 阅读全文
posted @ 2015-02-06 12:10 neverlandly 阅读(944) 评论(0) 推荐(0)
Lintcode: Delete Digits

摘要:Given string A representative a positive integer which has N digits, remove any k digits of the number, the remaining digits are arranged according to... 阅读全文
posted @ 2015-02-06 06:24 neverlandly 阅读(2576) 评论(0) 推荐(1)
Lintcode: Digit Counts

摘要:Count the number of k's between 0 and n. k can be 0 - 9.Exampleif n=12, in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], we have FIVE 1's (1, 10, 11, 12... 阅读全文
posted @ 2015-02-05 12:25 neverlandly 阅读(3330) 评论(0) 推荐(0)
Lintcode: Compare Strings

摘要:Compare two strings A and B, determine whether A contains all of the characters in B.The characters in string A and B are all Upper Case letters.Examp... 阅读全文
posted @ 2015-02-05 06:04 neverlandly 阅读(1383) 评论(0) 推荐(1)
Lintcode: First Position of Target (Binary Search)

摘要:Binary search is a famous question in algorithm.For a given sorted array (ascending order) and a target number, find the first index of this number in... 阅读全文
posted @ 2015-02-05 05:26 neverlandly 阅读(774) 评论(0) 推荐(0)
Lintcode: Binary Representation

摘要:Given a (decimal - e g 3.72) number that is passed in as a string,return the binary representation that is passed in as a string.If the number can no... 阅读全文
posted @ 2015-02-05 04:56 neverlandly 阅读(2020) 评论(0) 推荐(0)
Lintcode: Backpack II

摘要:Given n items with size A[i] and value V[i], and a backpack with size m. What's the maximum value can you put into the backpack?NoteYou cannot divide ... 阅读全文
posted @ 2015-02-04 14:36 neverlandly 阅读(2144) 评论(0) 推荐(1)
Lintcode: Backpack

摘要:Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack? NoteYou can not divide any item into s... 阅读全文
posted @ 2015-02-03 09:14 neverlandly 阅读(3805) 评论(2) 推荐(0)
Lintcode: A+B problem

摘要:For given numbers a and b in function aplusb, return the sum of them.NoteYou don't need to parse the input and output. Just calculate and return.Examp... 阅读全文
posted @ 2015-02-03 06:36 neverlandly 阅读(3932) 评论(0) 推荐(0)

上一页 1 2 3 4
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3