class Solution {
public:
    vector<int> maxInWindows(const vector<int>& num, unsigned int size) {
        if(size>num.size()) return {};
        vector<int>res;
        for(int i=0;i<=num.size()-size;i++){
            int max=0;
            for(int j=0;j<size;j++){
                if(num[i+j]>max) max=num[i+j];
                if(j==size-1) res.push_back(max);
            }
        }
        return res;
    }
};