码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果
力扣228. 汇总区间
原题 1 class Solution: 2 def summaryRanges(self, nums: List[int]) -> List[str]: 3 left,right,lens,ans = 0,0,len(nums),[] 4 while left < lens: 5 right = ...
分类:其他好文   时间:2021-02-15 11:47:09    阅读次数:0
力扣350. 两个数组的交集 II
原题 1 class Solution: 2 def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: 3 dic1,dic2 = {},{} 4 def helper(nums,dic): 5 for n in nu ...
分类:编程语言   时间:2021-02-10 12:50:25    阅读次数:0
1. 两数之和
给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。 你可以按任意顺序返回答案。 个人答案: class Solution: def twoSum ...
分类:其他好文   时间:2021-02-09 12:29:32    阅读次数:0
Solution -「ZROI 1762」规划
# $\mathcal{Description}$ &emsp;&emsp;[Link](http://zhengruioi.com/problem/1761). &emsp;&emsp;(貌似未氪金玩家不能看题的嗷……如果有不良影响私信我就好√) &emsp;&emsp;把 $n$ 个有标号的点划 ...
分类:其他好文   时间:2021-02-09 12:27:42    阅读次数:0
978. Longest Turbulent Subarray
仅供自己学习 思路: 1.很明显,又是滑动窗口的题,只要 if判断能满足 ><,或<>就让右指针右移一个元素,并且记录长度 right-left+1。如果不满足则 left = right,再重复上述步骤 代码: 1 class Solution { 2 public: 3 int maxTurbu ...
分类:其他好文   时间:2021-02-09 12:00:13    阅读次数:0
剑指offer58左旋字符串
# coding:utf-8 """ Name : 剑指offer58.py Author : qlb Contect : 17801044486@163.com Time : 2021/2/7 14:14 Desc: 左旋字符串 """ class Solution: def reverseLef ...
分类:其他好文   时间:2021-02-08 12:34:26    阅读次数:0
LeetCode28A是否是B的子串
恢复内容开始 # coding:utf-8 """ Name : LeetCode28.py Author : qlb Contect : 17801044486@163.com Time : 2021/2/7 17:17 Desc:实现 strStr() """ class Solution: d ...
分类:其他好文   时间:2021-02-08 12:33:47    阅读次数:0
aptitude 更新Ubntu 操作
aptitude与apt-get 源 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://archive. ...
分类:其他好文   时间:2021-02-08 12:18:42    阅读次数:0
24. 两两交换链表中的节点 - LeetCode
24. 两两交换链表中的节点 题目链接 直接换 class Solution { public ListNode swapPairs(ListNode head) { if(head == null) return null; if(head.next == null) return head; L ...
分类:其他好文   时间:2021-02-08 12:14:55    阅读次数:0
is_sorted
leetcode打卡 题面 class Solution { public: bool checkPossibility(vector<int> &nums) { int n = nums.size(); for (int i = 0; i < n - 1; ++i) { int x = nums[ ...
分类:其他好文   时间:2021-02-08 12:11:43    阅读次数:0
13024条   上一页 1 ... 25 26 27 28 29 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!