Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit ...
分类:
其他好文 时间:
2020-07-16 00:05:52
阅读次数:
79
地址:https://leetcode-cn.com/problems/consecutive-numbers/ ## 编写一个 SQL 查询,查找所有至少连续出现三次的数字。 示例: 编写一个 SQL 查询,查找所有至少连续出现三次的数字。 + + + | Id | Num | + + + | 1 ...
分类:
其他好文 时间:
2020-07-16 00:03:52
阅读次数:
59
import csv import random class XmlFormat(object): def __init__(self): self.wf = open('data/res_location.xml', 'w', encoding='utf-8') self.add_header() ...
分类:
其他好文 时间:
2020-07-15 23:52:04
阅读次数:
67
一 相关知识 1 range()函数 功能:python range() 函数可创建一个整数列表,一般用在 for 循环中。 语法:range(start, stop[, step]) 参数说明: start: 计数从 start 开始。默认是从 0 开始。 stop: 计数到 stop 结束,但不 ...
分类:
其他好文 时间:
2020-07-15 23:15:47
阅读次数:
75
go中数组是值拷贝, 切片是对上层数组的表示,应该是使用的是数组地址,修改时是直接对原来的数组进行修改 切片作为函数参数依旧如此 var array [5]int=[5]int{1,2,3,4,5}//可以简化为array:=[5]int{1,2,3,4,5} 初学所以没有简化 var slice[ ...
分类:
编程语言 时间:
2020-07-15 23:02:25
阅读次数:
78
Angle Between Hands of a Clock (M) 题目 Given two numbers, hour and minutes. Return the smaller angle (in degrees) formed between the hour and the minut ...
分类:
其他好文 时间:
2020-07-15 10:47:17
阅读次数:
102
260 Single Number III Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. ...
分类:
其他好文 时间:
2020-07-14 21:54:31
阅读次数:
104
题目描述: 方法:动态规划 class Solution: def winnerSquareGame(self, n: int) -> bool: dp = [False, True, False] for x in range(3, n+1): dp.append(False) for y in ...
分类:
其他好文 时间:
2020-07-14 00:20:11
阅读次数:
68
本文列举了十个使用一行代码即可独立完成(不依赖其他代码)的业务逻辑,主要依赖的是Java8中的Lambda和Stream等新特性以及try-with-resources、JAXB等。 1、对列表/数组中的每个元素都乘以2 // Range是半开区间 int [] ia = range(1, 10). ...
分类:
其他好文 时间:
2020-07-13 16:46:56
阅读次数:
97
题目描述如下: 分析如下: 此题目乍一看挺难的没有思路,其实很简单,他要找消失的两个数字,那么也及时其实原数组应该是在现有输入数组的基础上加上两个数字,此时range()函数就可以上场了,但是很多人说,你这样会有重复哎,咋办呢,直接使用set()去重复即可。 代码如下: 1 #!/usr/bin/e ...
分类:
其他好文 时间:
2020-07-13 11:31:50
阅读次数:
69