C++| O(N*30)
\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& nums) {\n        vector<int> dp(32,INT_MAX);\n        vector<int> re(nums.size(),1);
```\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& nums) {\n        vector<int> dp(32,INT_MAX);\n        vector<int> re(nums.size(),1);\n        int sum = 0;\n        for(int i = nums.size()-1;i>=0;--i){\n            sum=sum|nums[i];\n            int k = i;\n            for(int j = 0; j<30;++j){ \n                if(nums[i]&(1<<j)) dp[j] = min(dp[j],i);\n                if(dp[j]!=INT_MAX) k = max(k,dp[j]);\n            }\n            re[i] = k-i+1;\n        }\n        return re;\n    }\n};\n```
['Bit Manipulation', 'C']