![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
分治法
CIA_agent
这个作者很懒,什么都没留下…
展开
-
剑指offer 11. 旋转数组的最小数字
描述有一个长度为 n 的非降序数组,比如[1,2,3,4,5],将它进行旋转,即把一个数组最开始的若干个元素搬到数组的末尾,变成一个旋转数组,比如变成了[3,4,5,1,2],或者[4,5,1,2,3]这样的。请问,给定这样一个旋转数组,求数组中的最小值。数据范围:1≤n≤10000,数组中任意元素的值: 0≤val≤10000要求:空间复杂度:O(1)O(1) ,时间复杂度:O(logn)O(logn)示例1输入:[3,4,5,1,2]返回值:1示例2输入:[3,100,200,3]原创 2022-03-01 23:16:01 · 115 阅读 · 0 评论 -
leetcode 395. Longest Substring with At Least K Repeating Characters
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.Example 1:Input:s = “aaabb”, k = 3Outp...原创 2019-03-24 20:26:14 · 121 阅读 · 0 评论