码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
[LeetCode] 122. 买卖股票的最佳时机 II
靠 class Solution { public int maxProfit(int[] prices) { int profit=0; for(int i=1;i<prices.length;i++){ int tmp=prices[i]-prices[i-1]; if(tmp>0) profi ...
分类:其他好文   时间:2020-06-18 19:30:19    阅读次数:40
yum安装软件包提示Error Downloading Packages解决方法
在执行yum upgrade时报错 解决方法: 方法一: 1、清理本地yum缓存 执行:yum clean all 2、查看软件包列表 执行:yum list 注意:如果查询不到软件包列表,查看yum源是否配置正确。 方法二: 执行方法一之后,再去执行还是不成功,百度说是因为安装了python3的原 ...
分类:其他好文   时间:2020-06-18 15:54:21    阅读次数:296
leetcode-1014-最佳观光组合
解:O(N) class Solution: def maxScoreSightseeingPair(self, A: List[int]) -> int: left, res = A[0], -1 for j in range(1, len(A)): res = max(res, left + A ...
分类:其他好文   时间:2020-06-18 01:56:26    阅读次数:58
LeetCode 217
217. 存在重复元素 Java class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> s = new HashSet<>(); for(int i = 0 ; i<nums.length ; i++ ...
分类:其他好文   时间:2020-06-18 01:25:19    阅读次数:44
Not possible to upgrade a store with version 'v0.A.3' to current store version `v0.A.9` (Neo4j 3.5.5).
1.使用已有数据库时,报错 C:\Users\h>neo4j.bat console 2020-06-17 14:17:48.851+0000 WARN dbms.active_database is deprecated. 2020-06-17 14:17:48.870+0000 INFO Neo ...
分类:其他好文   时间:2020-06-18 01:22:24    阅读次数:68
6.17
1014. 最佳观光组合 a[i]+a[j]-(j-i)=a[i]+i-a[j]-j j要比i大,enmerate 使数组变成类似于字典 class Solution(object): def maxScoreSightseeingPair(self, A): mx=float('-inf') zo ...
分类:其他好文   时间:2020-06-18 01:00:15    阅读次数:94
【LeetCode-数组】最佳观光组合
题目描述 给定正整数数组 A,A[i] 表示第 i 个观光景点的评分,并且两个景点 i 和 j 之间的距离为 j - i。 一对景点(i < j)组成的观光组合的得分为(A[i] + A[j] + i - j):景点的评分之和减去它们两者之间的距离。 返回一对观光景点能取得的最高分。 示例: 输入: ...
分类:编程语言   时间:2020-06-17 23:40:13    阅读次数:60
算法---KMP
1. 2. 参考 https://leetcode-cn.com/problems/implement-strstr/solution/kmphua-48xiao-shi-kan-dong-liao-kmpxiang-rang-ni-z/ ...
分类:编程语言   时间:2020-06-17 23:25:17    阅读次数:56
80. 删除排序数组中的重复项 II(On)
80. 删除排序数组中的重复项 II class Solution { public: int removeDuplicates(vector<int>& nums) { if(nums.size()==0) return 0; if(nums.size()==1) return 1; int an ...
分类:编程语言   时间:2020-06-17 20:26:28    阅读次数:58
leetcode-1478-安排邮筒
方法:动态规划 class Solution: def minDistance(self, houses: List[int], k: int) -> int: houses.sort() n = len(houses) cost = [[0]*n for _ in range(n)] for i ...
分类:其他好文   时间:2020-06-17 20:08:50    阅读次数:40
共13024条   上一页 1 ... 85 86 87 88 89 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!