一个prev保存前一个状态,一个cur保存这次的状态每次按题意操作prev,然后赋值给cur 如何按题意操作呢? 1 11 21 1211 111221 一个变量say保存到目前为止相同的值,直到say和prev[i]不同,就给cur插入say的个数,和say的值,然后更新say为prev[i] ...
分类:
其他好文 时间:
2019-06-03 12:45:55
阅读次数:
89
[TOC] Supervised Learning Massive Unlabeled data Unsupervised Learning Why needed Dimension reduction Preprocessing:Huge dimension, say 224\ 224, is h ...
分类:
其他好文 时间:
2019-06-02 20:36:04
阅读次数:
103
lua在openresty中获取请求的请求头 local head_table = ngx.req.get_headers() 由于table类型,无法直接使用ngx.say()显示,需要转换为cjson local cjson = require "cjson" local tab_list = ...
分类:
其他好文 时间:
2019-05-29 13:07:47
阅读次数:
105
121. Best Time to Buy and Sell Stock 0. 参考文献 | 序号 | 文献 | | | | | 1 | [LeetCode:Best Time to Buy and Sell Stock I II III] | 1. 题目 Say you have an array ...
分类:
其他好文 时间:
2019-05-26 19:58:13
阅读次数:
159
1 构造函数 构造函数的优化: 上面构造函数的定义有一个弊端,如下 优化方式1: 但是这种方式也是有弊端的, 优化方式2: 通过改写构造函数的 原型对象,让方法say变得公用 3 prototype特点: 4 prototype,constructor, __proto__的三角恋关系 5 Func ...
分类:
编程语言 时间:
2019-05-26 18:14:24
阅读次数:
109
JS中的对象:自定义类,函数和一些原生对象,不存在一切皆对象这一说,对象就是对象。 首先什么是类。 类是汽车图纸,实例就是按照图纸把车造出来。 var Car = function (a, b) { this.name = a; this.age = b; } Car.prototype.say=f ...
分类:
编程语言 时间:
2019-05-20 01:18:57
阅读次数:
157
https://leetcode.com/problems/longest-string-chain/ Let's say word1 is a predecessor of word2 if and only if we can add exactly one letter anywhere in ...
分类:
其他好文 时间:
2019-05-19 13:59:38
阅读次数:
225
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 There are N queens in an infinite chessboard. We say two queens may attack ...
分类:
其他好文 时间:
2019-05-19 10:25:29
阅读次数:
131
print(name.capitalize())#首字母大写 print(name.swapcase())#大小写翻转 meg='egon say hi' print(mag.title())#每个单词的首字母大写 #内同后中,总长度,空白处尴充ret2=a1.center(20,"*") prin... ...
分类:
其他好文 时间:
2019-05-13 23:12:25
阅读次数:
124
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of ...
分类:
其他好文 时间:
2019-05-11 09:46:34
阅读次数:
135