会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
habibah_chang
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
18
19
20
21
22
23
24
25
26
···
44
下一页
2020年8月16日
744. Find Smallest Letter Greater Than Target
摘要: 问题: 给定一个升序字符数组。 求比给定target字符大的,最小的字符。(假设给定字符数组是循环的,即第一个字符>最后一个字符) Examples: Input: letters = ["c", "f", "j"] target = "a" Output: "c" Input: letters =
阅读全文
posted @ 2020-08-16 13:19 habibah_chang
阅读(140)
评论(0)
推荐(0)
2020年8月14日
436. Find Right Interval
摘要: 问题: 给定一组间隔列表,每个间隔有[left, right]两个值组成。 对于每一个间隔,求是否有另一个间隔在它的右边:另一个间隔的left>=这个间隔的right 若存在,将满足的index最小的另一个间隔的index存入结果。 否则将 -1 存入结果。 Example 1: Input: [
阅读全文
posted @ 2020-08-14 16:51 habibah_chang
阅读(111)
评论(0)
推荐(0)
50. Pow(x, n)
摘要: 问题: 实现x^n的幂运算。 Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2.10000, 3 Output: 9.26100 Example 3: Input: 2.00000, -2 Output: 0.2
阅读全文
posted @ 2020-08-14 16:05 habibah_chang
阅读(113)
评论(0)
推荐(0)
29. Divide Two Integers
摘要: 问题: 给定 被除数 和 除数,不借助 乘法、除法、模运算,实现除法运算。 Example 1: Input: dividend = 10, divisor = 3 Output: 3 Explanation: 10/3 = truncate(3.33333..) = 3. Example 2: I
阅读全文
posted @ 2020-08-14 15:15 habibah_chang
阅读(102)
评论(0)
推荐(0)
2020年8月13日
1539. Kth Missing Positive Number
摘要: 问题: 给定一个升序数组,求第k个该数组缺失的数。 Example 1: Input: arr = [2,3,4,7,11], k = 5 Output: 9 Explanation: The missing positive integers are [1,5,6,8,9,10,12,13,...
阅读全文
posted @ 2020-08-13 15:47 habibah_chang
阅读(203)
评论(0)
推荐(0)
1283. Find the Smallest Divisor Given a Threshold
摘要: 问题: 给定一个数组,求一个除数, 使得数组中每个元素被该数除后(有余数则结果+1)的和,不超过threshold。 (For example: 7/3 = 3 and 10/2 = 5). Example 1: Input: nums = [1,2,5,9], threshold = 6 Outp
阅读全文
posted @ 2020-08-13 14:36 habibah_chang
阅读(99)
评论(0)
推荐(0)
378. Kth Smallest Element in a Sorted Matrix
摘要: 问题: 给定一个二维数组,每一行,每一列,都是升序排列的。 但A[0][1]不一定<A[1][0](右上↗︎元素不一定<左下元素↙︎,但左上↖︎一定<右下↘︎) 求整个二维素组中第K个大的元素值。 Example: matrix = [ [ 1, 5, 9], [10, 11, 13], [12,
阅读全文
posted @ 2020-08-13 13:53 habibah_chang
阅读(85)
评论(0)
推荐(0)
875. Koko Eating Bananas
摘要: 问题: Koko吃香蕉的速度为K, 有一组香蕉盘piles,每个盘里装有不同数量的香蕉, 每小时Koko可以选择一盘吃完。 若这一盘<K,那么这一小时Koko只能吃到这一盘数量的香蕉。 若这一盘>K,那么这一小时Koko吃了K个香蕉。下一小时,继续吃完这一盘。 求在给定的H小时中,吃完所有香蕉,最小
阅读全文
posted @ 2020-08-13 13:06 habibah_chang
阅读(141)
评论(0)
推荐(0)
2020年8月12日
278. First Bad Version
摘要: 问题: 给定到目前为止的最终版本号n 则已有[1,2,...,n]这些版本, 在这些版本中,若第一次出现了坏的版本,那么它之后的版本都为坏的版本。 求第一个坏版本的版本号。 给定API来判断某个版本x是否为坏的版本 bool isBadVersion(version) Example: Given
阅读全文
posted @ 2020-08-12 14:58 habibah_chang
阅读(102)
评论(0)
推荐(0)
704. Binary Search
摘要: 问题: 二分查找,给定一个已排序的数组,和一个目标值target 在该数组中找到target的index返回,若没找到,则返回-1。 Example 1: Input: nums = [-1,0,3,5,9,12], target = 9 Output: 4 Explanation: 9 exist
阅读全文
posted @ 2020-08-12 10:20 habibah_chang
阅读(89)
评论(0)
推荐(0)
上一页
1
···
18
19
20
21
22
23
24
25
26
···
44
下一页
公告