摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: 原题地址: Max Consecutive Ones 难度: Easy 题意: 找出连续为1的子数组的最大长度 思路1: 阅读全文
posted @ 2018-09-29 12:18 静静地挖坑 阅读(323) 评论(0) 推荐(0)
摘要: Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar of ca 阅读全文
posted @ 2018-09-29 11:23 静静地挖坑 阅读(126) 评论(0) 推荐(0)
摘要: An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[j]. A 阅读全文
posted @ 2018-09-28 20:28 静静地挖坑 阅读(196) 评论(0) 推荐(0)
摘要: 代码: 报错: 数组: 为什么? 等式右边 t[t[5]-1] 相当于 t[0] ,是对值-10的引用.首先是将t[5]的引用指向-10,此时 t[5] 的值变为-10,左边 t[t[5]-1] 相当于变成 t[-11] 阅读全文
posted @ 2018-09-26 11:15 静静地挖坑 阅读(456) 评论(0) 推荐(0)
摘要: 由于版本问题,React中history不可用 首先应该导入react-router-dom包: 以前的写法: 这种方式会报错: 可以用 history包 (需要安装 npm install --save history )进行修改: 参考:https://stackoverflow.com/que 阅读全文
posted @ 2018-09-12 09:58 静静地挖坑 阅读(4110) 评论(0) 推荐(0)
摘要: 某图书馆收藏有书籍具有不同的出版年份,管理员需要做一下统计工作: (1)每一年书籍的数目,如: 2000年有10本书, 2001年有5本书... (2)每一种书籍的数目,如: 西游记有10本, 三国演义有5本... (3)每一种书不同年份对应的数目, 如2本西游记在2000出版的,8本在2008年出 阅读全文
posted @ 2018-09-11 19:34 静静地挖坑 阅读(3166) 评论(0) 推荐(0)
摘要: 数据表xiami_1,结构如下: 解释一下表数据: id: 序号 singer: 歌手名 title:歌曲名称 song_url: 歌曲链接 hot:歌曲听过的次数 area:歌手所属地区 数据量:390万 总时间 (查询次数*每一次查询时间) insert into xiami_1(singer, 阅读全文
posted @ 2018-09-11 17:13 静静地挖坑 阅读(216) 评论(0) 推荐(0)
摘要: 涉及的关键字: where order by limit select from having like 1. from后面跟随table,最先访问 ==> 找到表 2.先选择字段还是操作记录,如果先选择字段,就无法操作记录,选择应从大范围查询到小范围,所以先进行记录处理. 那先进行排序还是limi 阅读全文
posted @ 2018-09-11 13:27 静静地挖坑 阅读(211) 评论(0) 推荐(0)
摘要: 1.普通索引 2.唯一性索引 3.主键 创建索引 查看索引 阅读全文
posted @ 2018-09-11 12:43 静静地挖坑 阅读(87) 评论(0) 推荐(0)
摘要: 明明数据库里的编码方式和字符集都没有问题,用python插入数据时,数据库里的数据还是乱码的 在数据库中插入时,能够正常显示 那就是python导出的数据存在编码问题,代码如下: 网上搜索了一下,添加两个参数use_unicode, charsetjike,修改后代码如下: 数据库输入就显示正常了 阅读全文
posted @ 2018-09-11 10:51 静静地挖坑 阅读(4371) 评论(0) 推荐(0)