Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. 1. use an arr ...
分类:
其他好文 时间:
2018-09-23 15:06:24
阅读次数:
122
"原题:279. Perfect Squares" Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. ...
分类:
其他好文 时间:
2018-09-20 16:02:50
阅读次数:
151
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: E ...
分类:
编程语言 时间:
2018-09-20 11:22:11
阅读次数:
162
// Returns maximum sum of a subarray with at-least // k elements. static int maxSumWithK(int a[], int n, int k) { // maxSum[i] is going to store maxim... ...
分类:
其他好文 时间:
2018-09-20 11:07:17
阅读次数:
178
centos 6.5 mysql5.7 在从库作stop slave时报: error:ERROR 1794 (HY000): Slave is not configured or failed to initialize properly. You must at least set --serv ...
分类:
其他好文 时间:
2018-09-19 23:33:13
阅读次数:
366
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following req ...
分类:
其他好文 时间:
2018-09-16 12:25:21
阅读次数:
169
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array[?2,1,?3,4,?1,2,1 ...
分类:
其他好文 时间:
2018-09-14 00:05:17
阅读次数:
171
Java提供了4种注解,专门负责新注解的创建: @Target: 表示该注解可以用于什么地方,可能的ElementType参数有:CONSTRUCTOR:构造器的声明FIELD:域声明(包括enum实例)LOCAL_VARIABLE:局部变量声明METHOD:方法声明PACKAGE:包声明PARAM ...
分类:
编程语言 时间:
2018-09-10 13:37:28
阅读次数:
194
思路: 尺取法。 循环i:1~26,分别计算恰好包含i种字母并且每种字母出现的次数大于等于k个的最长子串长度。 没法直接使用尺取法,因为不满足区间单调性,但是使用如上的方法却是可以的,因为子串中包含的字母种类数是满足区间单调性的。 实现: ...
分类:
其他好文 时间:
2018-09-09 21:05:54
阅读次数:
185
下周任务: 1:python 多进程爬取豆瓣影评。 2:自然语言处理概念入门。 3:leetcode(at least 3 anwsers) 算法基础(at least three times a week) 4:信息安全(at least two times a week) 5:reading o ...
分类:
其他好文 时间:
2018-09-09 16:46:42
阅读次数:
146