2021年4月5日

摘要: 题目描述 Given a collection of intervals, merge all overlapping intervals.For example, Given[1,3],[2,6],[8,10],[15,18], return[1,6],[8,10],[15,18]. /** * 阅读全文
posted @ 2021-04-05 07:11 朴素贝叶斯 阅读(23) 评论(0) 推荐(0) 编辑

2021年4月4日

摘要: 题目描述 Given an unsorted integer array, find the first missing positive integer.For example, Given[1,2,0] return 3,and [3,4,-1,1] return 2. Your algorit 阅读全文
posted @ 2021-04-04 22:20 朴素贝叶斯 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个包含 n + 1 个整数的数组 nums,其数字都在 1 到 n 之间(包括 1 和 n),可知至少存在一个重复的整数。假设只有一个重复的整数,找出这个重复的数。 示例 1: 输入: [1,3,4,2,2] 输出: 2 示例 2: 输入: [3,1,3,4,2] 输出: 3 说明: 阅读全文
posted @ 2021-04-04 21:19 朴素贝叶斯 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may co 阅读全文
posted @ 2021-04-04 20:03 朴素贝叶斯 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may co 阅读全文
posted @ 2021-04-04 18:57 朴素贝叶斯 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transac 阅读全文
posted @ 2021-04-04 18:11 朴素贝叶斯 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个整数数组 nums ,找出一个序列中乘积最大的连续子序列(该序列至少包含一个数)。 示例 1: 输入: [2,3,-2,4] 输出: 6 解释: 子数组 [2,3] 有最大乘积 6。 示例 2: 输入: [-2,0,-1] 输出: 0 解释: 结果不能为 2, 因为 [-2,-1] 阅读全文
posted @ 2021-04-04 17:32 朴素贝叶斯 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1 阅读全文
posted @ 2021-04-04 16:41 朴素贝叶斯 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个未排序的整数数组,找出最长连续序列的长度。要求算法的时间复杂度为 O(n)。 示例: 输入: [100, 4, 200, 1, 3, 2] 输出: 4 解释: 最长连续序列是 [1, 2, 3, 4]。它的长度为 4。 代码实现 class Solution { public: i 阅读全文
posted @ 2021-04-04 16:13 朴素贝叶斯 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra s 阅读全文
posted @ 2021-04-04 15:35 朴素贝叶斯 阅读(26) 评论(0) 推荐(0) 编辑

导航