Problem Description: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. 题解: 这个题很容易想到复杂度为O(n^2)的暴力方法。 ...
分类:
其他好文 时间:
2019-03-29 17:27:16
阅读次数:
133
Use prefix product(sum? actually much the same). ...
分类:
其他好文 时间:
2019-03-28 23:23:06
阅读次数:
284
网址:https://leetcode.com/problems/maximum-subarray/submissions/ 很简单的动态规划 我们可以把 dp[i] 表示为index为 i 的位置上的Maximum 容易得出,dp[i] = max( nums[i] , dp[i-1] + num ...
分类:
其他好文 时间:
2019-03-28 19:29:23
阅读次数:
185
网址:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/ 其实就是斐波那契数列,没什么好说的。 注意使用3个变量,而不是数组,可以节约空间。 ...
分类:
其他好文 时间:
2019-03-28 00:32:21
阅读次数:
163
写类似朋友圈界面的时候有九宫格,2*2的图片展示,用的gridlayout,运行的时候会崩溃,报错如下 java.lang.IllegalArgumentException: columnCount must be greater than or equal to the maximum of al ...
分类:
其他好文 时间:
2019-03-25 14:55:35
阅读次数:
317
<编程题> 1、[Maximum Product Subarray 求最大子数组乘积] 这个求最大子数组乘积问题是由最大子数组之和问题演变而来,但是却比求最大子数组之和要复杂,因为在求和的时候,遇到0,不会改变最大值,遇到负数,也只是会减小最大值而已。而在求最大子数组乘积的问题中,遇到0会使整个乘积 ...
分类:
编程语言 时间:
2019-03-24 18:47:34
阅读次数:
159
概述 我们都知道 TCP 是 可靠的数据传输协议,UDP是不可靠传输,那么TCP它是怎么保证可靠传输的呢?那我们就不得不提 TCP 的三次握手和四次挥手。 三次握手 下图为三次握手的流程图 下面通过我们 wireshark 抓包工具来分析三次握手 三次握手数据包 第一次握手 建立连接。客户端发送连接 ...
分类:
其他好文 时间:
2019-03-23 19:47:33
阅读次数:
146
A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i+2} for all i + 2 <= n Given a strictly increasing array A of positive ...
分类:
其他好文 时间:
2019-03-23 12:58:30
阅读次数:
118
错误现象: 验证位置时发生错误:"org.apache.subversion.javahl.ClientException:svn:E210004: Number is larger than maximum". 处理过程: 在处理这个问题的过程中在网上找了好几种方法试过之后还是会出现位置错误的提示 ...
分类:
系统相关 时间:
2019-03-21 10:39:23
阅读次数:
198
446. Arithmetic Slices II - Subsequence Hard Hard A sequence of numbers is called arithmetic if it consists of at least three elements and if the diff ...
分类:
其他好文 时间:
2019-03-21 01:23:53
阅读次数:
155