码迷,mamicode.com
首页 >  
搜索关键字:ztr loves lucky numbers    ( 8622个结果
剑指 Offer 11. 旋转数组的最小数字 Java
可以想到,数组中会出现“断层”,直接遍历一次即可。不存在【1,2,3,4,5】旋转成【5,4,3,2,1】的情况。 暴力法(我感觉还行啊,为什么被叫暴力): class Solution { public int minArray(int[] numbers) { int n = numbers.l ...
分类:编程语言   时间:2020-07-22 11:13:53    阅读次数:50
git merge的三种操作merge, squash merge, 和rebase merge
原作者:CodingCode 原链接:https://www.jianshu.com/p/ff1877c5864e git merge的三种操作merge, squash merge, 和rebase merge 举例来说: 假设在master分支的B点拉出一个新的分支dev,经过一段时间开发后: ...
分类:其他好文   时间:2020-07-21 22:33:40    阅读次数:71
eval报错NameError: name 'null' is not defined
在转换的字符串中,存在null时,就会出现NameError: name ‘null’ is not defined这个错误。 解决办法:使用replace方法将null替换掉 注意:replace argument 2 must be str replace的两个参数都必须为字符串 str.rep ...
分类:其他好文   时间:2020-07-21 13:58:35    阅读次数:67
167两数之和II-输入有序数组
from typing import List# 这道题很容易能够想到,只需要遍历两边列表就可以了# 两层循环class Solution: def twoSum(self, numbers: List[int], target: int) -> List[int]: # 第一次遍历列表 for i ...
分类:编程语言   时间:2020-07-21 01:14:53    阅读次数:97
LeetCode0167.两数之和 II - 输入有序数组
题目要求 算法分析 可以用双指针法, 分别指向头尾元素,如果两元素的和大于目标,尾指针前移,如果小于目标,头指针后移,等于目标即可得答案 代码展示(C#) public class Solution { public int[] TwoSum(int[] numbers, int target) { ...
分类:编程语言   时间:2020-07-20 10:40:01    阅读次数:55
Codeforces #657 Problem B
##题目 Pasha loves to send strictly positive integers to his friends. Pasha cares about security, therefore when he wants to send an integer n, he encry ...
分类:其他好文   时间:2020-07-19 23:37:51    阅读次数:80
1060. Missing Element in Sorted Array
package LeetCode_1060 /** * 1060. Missing Element in Sorted Array * (Prime) * Given a sorted array A of unique numbers, find the K-th missing number s ...
分类:其他好文   时间:2020-07-19 00:49:27    阅读次数:93
1019 数字黑洞 (20分)/1069 The Black Hole of Numbers (20分)
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; bool cmp(int a,int b){ return a>b; } void to_array(int n,int num []) { fo ...
分类:其他好文   时间:2020-07-18 11:39:12    阅读次数:78
初级美语 L027:Jack and His Dog 解析
一、Reading Jack seldom gets together with his friends. He usually stays at home with his pet dog, Lucky. They sometimes go for long walks in the park. ...
分类:其他好文   时间:2020-07-17 14:08:23    阅读次数:76
leetcode148two-sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n ...
分类:其他好文   时间:2020-07-17 13:33:50    阅读次数:46
8622条   上一页 1 ... 10 11 12 13 14 ... 863 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!