leetcodo697专题

Leetcodo697.数组的度 ——codetop

题目 697. 数组的度 - 力扣(LeetCode) 代码(首刷自解) class Solution {public:int findShortestSubArray(vector<int>& nums) {// 遍历一遍,记录每个数字的起始位置// 当度更新时,记录最大新最大长度int res = 1;//长度unordered_map<int, pair<int, int>>