上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 125 下一页

2020年5月3日

摘要: 地址 https://leetcode-cn.com/problems/assign-cookies/ 假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。对每个孩子 i ,都有一个胃口值 gi ,这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j ,都有一个 阅读全文
posted @ 2020-05-03 23:09 itdef 阅读(150) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/is-subsequence/ 给定字符串 s 和 t ,判断 s 是否为 t 的子序列。 你可以认为 s 和 t 中仅包含英文小写字母。字符串 t 可能会很长(长度 ~= 500,000),而 s 是个短字符串(长度 <=10 阅读全文
posted @ 2020-05-03 21:27 itdef 阅读(304) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/lemonade-change/ 在柠檬水摊上,每一杯柠檬水的售价为 5 美元。 顾客排队购买你的产品,(按账单 bills 支付的顺序)一次购买一杯。 每位顾客只买一杯柠檬水,然后向你付 5 美元、10 美元或 20 美元。你 阅读全文
posted @ 2020-05-03 15:29 itdef 阅读(247) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/maximum-subarray/ 给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 示例: 输入: [-2,1,-3,4,-1,2,1,-5,4], 输出: 6 解释: 连 阅读全文
posted @ 2020-05-03 14:31 itdef 阅读(142) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/sparse-similarity-lcci/ 两个(具有不同单词的)文档的交集(intersection)中元素的个数除以并集(union)中元素的个数,就是这两个文档的相似度。例如,{1, 5, 3} 和 {1, 7, 2, 阅读全文
posted @ 2020-05-03 11:26 itdef 阅读(427) 评论(0) 推荐(0)

2020年5月2日

摘要: 地址 https://leetcode-cn.com/problems/single-number-ii/ 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现了三次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 示例 1: 阅读全文
posted @ 2020-05-02 12:32 itdef 阅读(238) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ 题目描述给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 样例示例 1: 输入: "abcabcbb"输出: 3 解 阅读全文
posted @ 2020-05-02 11:17 itdef 阅读(863) 评论(0) 推荐(0)

2020年5月1日

摘要: 地址 https://leetcode-cn.com/problems/single-number/ 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 示例 1: 输入: 阅读全文
posted @ 2020-05-01 23:25 itdef 阅读(214) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/power-of-two/ 给定一个整数,编写一个函数来判断它是否是 2 的幂次方。 示例 1: 输入: 1 输出: true 解释: 20 = 1 示例 2: 输入: 16 输出: true 解释: 24 = 16 示例 3: 阅读全文
posted @ 2020-05-01 22:13 itdef 阅读(211) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/merge-two-sorted-lists/ 目描述将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 样例示例: 输入:1->2->4, 1->3->4输出:1->1->2->3-> 阅读全文
posted @ 2020-05-01 13:18 itdef 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 125 下一页

导航