Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Idea 1. Dynamic pr ...
分类:
其他好文 时间:
2019-05-09 10:46:05
阅读次数:
99
In an array containing only 0s and 1s, a bit flip consists of choosing a (contiguous) subarray of length and simultaneously changing every 0 in the su ...
分类:
其他好文 时间:
2019-04-30 01:08:50
阅读次数:
133
原题地址 D. Beautiful Array 原题地址 D. Beautiful Array You are given an array aa consisting of nn integers. Beauty of array is the maximum sum of some consec ...
分类:
其他好文 时间:
2019-04-23 20:44:45
阅读次数:
193
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Inpu ...
分类:
编程语言 时间:
2019-04-17 20:51:31
阅读次数:
232
简单的dp. 其实不用dp这个数组,就维护一个最大值ret就行. ...
分类:
其他好文 时间:
2019-04-13 00:43:01
阅读次数:
135
Description: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct wa ...
分类:
编程语言 时间:
2019-04-09 20:39:21
阅读次数:
213
断网导致原来写的那么多答案全没了,博客园能不能实时保存草稿,醉。 https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/ 给一个数组a,找和大于k的所有子数组中的最短的那个。 最近二分有点上头,因为的确很强大,两个考虑 ...
分类:
其他好文 时间:
2019-04-07 18:05:37
阅读次数:
134
Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to least-si ...
分类:
其他好文 时间:
2019-04-04 09:24:23
阅读次数:
178
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be ...
分类:
其他好文 时间:
2019-04-02 22:45:53
阅读次数:
185
1029. Binary Prefix Divisible By 5 Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (fr ...
分类:
其他好文 时间:
2019-03-31 13:29:27
阅读次数:
147