首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
leetcodo697专题
Leetcodo697.数组的度 ——codetop
题目 697. 数组的度 - 力扣(LeetCode) 代码(首刷自解) class Solution {public:int findShortestSubArray(vector<int>& nums) {// 遍历一遍,记录每个数字的起始位置// 当度更新时,记录最大新最大长度int res = 1;//长度unordered_map<int, pair<int, int>>
阅读更多...