码迷,mamicode.com
首页 >  
搜索关键字:consecutive numbers    ( 8082个结果
762. Prime Number of Set Bits in Binary Representation
Problem : Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary repr ...
分类:其他好文   时间:2020-04-20 11:50:44    阅读次数:65
两数相加
此博客链接: 两数相加() 题目链接:https://leetcode-cn.com/problems/add-two-numbers/comments/ class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) ...
分类:其他好文   时间:2020-04-20 10:27:00    阅读次数:77
1295. 统计位数为偶数的数字
给你一个整数数组 nums,请你返回其中位数为 偶数 的数字的个数。 示例 1: 输入:nums = [12,345,2,6,7896]输出:2解释:12 是 2 位数字(位数为偶数) 345 是 3 位数字(位数为奇数) 2 是 1 位数字(位数为奇数) 6 是 1 位数字 位数为奇数) 7896 ...
分类:其他好文   时间:2020-04-19 22:36:32    阅读次数:91
728. Self Dividing Numbers
Problem : A self dividing number is a number that is divisible by every digit it contains. For example, 128 is a self dividing number because 128 % 1 ...
分类:其他好文   时间:2020-04-19 09:12:52    阅读次数:59
剑指offer:最小的K个数
题意描述 输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,。 解题思路 一、冒泡排序/选择排序 对数组进行排序,从数组中取出最小的k个数。不需要对数组全部排序,只需要找出前k个数即可。 二、快速排序 利用快速排序 划分 的思想, ...
分类:其他好文   时间:2020-04-18 22:49:10    阅读次数:54
Python使用openpyxl读写excel文件
这是一个第三方库,可以处理xlsx格式的Excel文件。pip install openpyxl安装。如果使用Aanconda,应该自带了。 读取Excel文件 需要导入相关函数。 1 from openpyxl import load_workbook 2 3 # 默认可读写,若有需要可以指定wr ...
分类:编程语言   时间:2020-04-18 18:34:24    阅读次数:58
646. Maximum Length of Pair Chain
Problem : You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can ...
分类:其他好文   时间:2020-04-18 10:09:19    阅读次数:67
scala - 基础:Scala fold, foldLeft, foldRight
说明 从本质上来讲,fold方法读取一种数据,然后返回给你另外一种。 fold和foldLeft和foldRight做的事同样的事情,仅有一点点不同。 fold val numbers = List(1, 2, 3, 4, 5) val res = numbers.fold(10) { (z, i)... ...
分类:其他好文   时间:2020-04-18 09:32:45    阅读次数:47
leetcode刷题2-两数之和
给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 来源:力扣(LeetCode)链接: ...
分类:其他好文   时间:2020-04-18 09:27:22    阅读次数:62
CodeForces 55D Beautiful numbers
"CodeForces 55D Beautiful numbers" 一句话题意:有T组询问,每次询问区间[l, r]中的beautiful number有多少。beautiful number是指这个数可以被组成它的数字整除。例如15是beautiful number,因为15可以被1整除,也可以 ...
分类:其他好文   时间:2020-04-17 18:39:23    阅读次数:57
8082条   上一页 1 ... 24 25 26 27 28 ... 809 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!