✅Simple solution using Binary Search
\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& nums) {\n        int n=nums.size();\n        \n        vector<vector<int>> list(n, v
```\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& nums) {\n        int n=nums.size();\n        \n        vector<vector<int>> list(n, vector<int>(30));\n        for(int i=0;i<n;i++) {\n            int temp = nums[i];\n            for(int j=0;j<30;j++) {\n                list[i][j]=temp%2;\n                temp/=2;\n            }\n        }\n        \n        vector<vector<int>>  prefix(n, vector<int>(30)), for_bi(30, vector<int>(n));\n        prefix[0] = list[0];\n        for(int i=1;i<n;i++) {\n            for(int j=0;j<30;j++) {\n                prefix[i][j]=prefix[i-1][j]+list[i][j];\n                for_bi[j][i]=prefix[i][j];\n            }\n        }\n        \n        vector<int> compare(30);\n        compare = prefix[n-1];\n        \n        vector<int> ans(n);\n        ans[n-1] = 1;\n        \n        for(int i=0;i<n-1;i++) {\n            int temp = 1;\n            for(int j=0;j<30;j++) {\n                if(prefix[i][j]<compare[j] && list[i][j]==0) {\n                    vector<int>::iterator fk=lower_bound(for_bi[j].begin()+i,for_bi[j].end(),prefix[i][j]+1);\n                    int x = (fk - (for_bi[j].begin()+i));\n                    temp = max(temp, x + 1);\n                }\n            }\n            ans[i]=temp;\n        }\n        return ans;\n    }\n};\n```
['Binary Search', 'C++']