class Solution {public:long long size;bool containsNearbyAlmostDuplicate(vector<int>& nums, int indexDiff, int valueDiff) {//桶排序unordered_map<long,long> m;size=valueDiff+1;for(int i=0;i<nums.size()
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3Output:[[ 1, 2, 3 ],[ 8, 9, 4 ],[ 7, 6, 5 ]] 题目链接:https://leetcode.com/pr