题目如下: Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, ot ...
分类:
其他好文 时间:
2020-02-09 18:31:58
阅读次数:
64
看到已有的题解几乎都是栈操作,但是考虑到leetcode的数据量一直都不大,所以跑一般oj10w长度的字符串很难说栈操作会不会超时,因此尝试生成了10w长度的数据,结果果然效率不够高,因此打算来记录一下笔者的解法 以给的范例"(ed(et(oc))el)"为例,从左到右开始计算,e从1到8,d从2到 ...
分类:
其他好文 时间:
2020-02-09 16:57:52
阅读次数:
146
1、抽奖 1)、用户参与抽奖:SADD order 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 2)、查看所有参与抽奖的人:SMEMBERS order 3)、重复抽奖每次抽取两人:SMEMBERS order 2 4)、不重复抽奖,三等奖3人 ...
分类:
其他好文 时间:
2020-02-09 16:29:06
阅读次数:
80
第一种: public static void main(String[] args) { //遍历Map 第一种方式 Map<String, Integer> map1 = new HashMap<String, Integer>(); map1.put("jack", 20); map1.put ...
分类:
其他好文 时间:
2020-02-09 14:51:53
阅读次数:
80
环境 springBoot+JPA+MySQL application-dev.yml 注意:配置中的blog数据库需要先创建,否则启动springBoot会报错 1 spring: 2 #数据库连接配置 3 datasource: 4 driver-class-name: com.mysql.jd ...
分类:
数据库 时间:
2020-02-09 11:59:11
阅读次数:
91
前言 反转链表是程序员必备的基本素养,经常在面试、笔试的过程中出现。一直觉得反转链表实现代码不是很好理解,决定搬leetcode那道经典反转链表题出来,用十多张图去解析它,希望加深大家对链表反转的理解,谢谢阅读。 leetcode的反转链表原题&答案 题目描述: 反转一个单链表。 分析: 假设存在链 ...
分类:
其他好文 时间:
2020-02-09 09:35:45
阅读次数:
81
Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other o ...
分类:
其他好文 时间:
2020-02-08 22:02:58
阅读次数:
86
题目如下: Given an array of integers arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < arr.length and 0 < x <= d. ...
分类:
其他好文 时间:
2020-02-08 16:04:58
阅读次数:
64
Python三引号:多用作注释、数据库语句、编写 HTML 文本。 strs = ''' 使用了三引号的字符串 ''' print (strs) # 在 ‘’‘ 里可以使用转义字符 strs = '''开始 使用反斜杠 \\ 单引号 \' 双引号 \" 换行 \n 水平制表符 \t 结束。 ''' ...
分类:
编程语言 时间:
2020-02-08 15:28:32
阅读次数:
73
# -*- coding: utf-8 -*- from PIL import Image import numpy as np def print_photo(photo_file, width=120, k=1.0, reverse=False, outfile=None): """打印照片,默 ...
分类:
其他好文 时间:
2020-02-08 15:23:11
阅读次数:
295