上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. 阅读全文
posted @ 2016-03-20 14:18 哥布林工程师 阅读(146) 评论(0) 推荐(0)
摘要: Calculate the a^n % b where a, b and n are all 32bit integers. For 2^31 % 3 = 2 For 100^1000 % 1000 = 0 这道题有个值得注意的问题,当n为奇数的时候,如果把递归写成: long num = fast 阅读全文
posted @ 2016-03-20 14:11 哥布林工程师 阅读(144) 评论(0) 推荐(0)
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another ex 阅读全文
posted @ 2016-03-20 13:51 哥布林工程师 阅读(126) 评论(0) 推荐(0)
摘要: Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
posted @ 2016-03-20 13:44 哥布林工程师 阅读(186) 评论(0) 推荐(0)
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Given dividend = 100 and divisor = 9 阅读全文
posted @ 2016-03-20 12:56 哥布林工程师 阅读(127) 评论(0) 推荐(0)
摘要: Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from t 阅读全文
posted @ 2016-03-20 07:10 哥布林工程师 阅读(166) 评论(0) 推荐(0)
摘要: Count the number of k's between 0 and n. k can be 0 - 9. if n=12, k=1 in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], we have FIVE 1's(1, 10, 11, 12) 阅读全文
posted @ 2016-03-18 13:09 哥布林工程师 阅读(111) 评论(0) 推荐(0)
摘要: 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 @ 2016-03-18 12:56 哥布林工程师 阅读(150) 评论(0) 推荐(0)
摘要: A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2016-03-18 12:36 哥布林工程师 阅读(154) 评论(0) 推荐(0)
摘要: Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you 阅读全文
posted @ 2016-03-18 08:18 哥布林工程师 阅读(172) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页