jzoffer

package
v0.0.0-...-6c0d317 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

* @Author: yiGmMk marvelousme@163.com * @Date: 2022-07-27 18:19:52 * @LastEditors: yiGmMk marvelousme@163.com * @LastEditTime: 2022-07-27 18:19:53 * @FilePath: /go-tool/home/admin/code/coding-practicing/golang/209/209.长度最小的子数组.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

* @lc app=leetcode.cn id=209 lang=golang * * [209] 长度最小的子数组 * * https://leetcode.cn/problems/minimum-size-subarray-sum/description/ * * algorithms * Medium (48.58%) * Likes: 1270 * Dislikes: 0 * Total Accepted: 380.1K * Total Submissions: 782.9K * Testcase Example: '7\n[2,3,1,2,4,3]' * * 给定一个含有 n 个正整数的数组和一个正整数 target 。 * * 找出该数组中满足其和 ≥ target 的长度最小的 连续子数组 [numsl, numsl+1, ..., numsr-1, numsr] * ,并返回其长度。如果不存在符合条件的子数组,返回 0 。 * * * * 示例 1: * * * 输入:target = 7, nums = [2,3,1,2,4,3] * 输出:2 * 解释:子数组 [4,3] 是该条件下的长度最小的子数组。 * * * 示例 2: * * * 输入:target = 4, nums = [1,4,4] * 输出:1 * * * 示例 3: * * * 输入:target = 11, nums = [1,1,1,1,1,1,1,1] * 输出:0 * * * * * 提示: * * * 1 * 1 * 1 * * * * * 进阶: * * * 如果你已经实现 O(n) 时间复杂度的解法, 请尝试设计一个 O(n log(n)) 时间复杂度的解法。 * *

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL