You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//set store elements in sorted order to find min or max simply use *set.rbegin() = max and *set.begin() = min elements. window length = right -left +1;
class Solution {
public:
int longestSubarray(vector<int>& nums, int limit) {