[C++| Bit Maipulation
\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& a) \n    {\n      vector<int> ans(a.size(),1);\n      vector<int> temp(30,0);\n     
```\nclass Solution {\npublic:\n    vector<int> smallestSubarrays(vector<int>& a) \n    {\n      vector<int> ans(a.size(),1);\n      vector<int> temp(30,0);\n      for(int i=a.size()-1; i>=0; i--)\n      {\n        int maxval=0;\n        for(int j=0;j<30;j++)\n        {\n          if(((1<<j) & a[i])==0)\n            maxval=max(maxval,temp[j]);\n          ans[i]=max(maxval-i+1,1); \n        }\n        \n        for(int j=0;j<30;j++)\n        {\n          if((1<<j) & a[i])\n            temp[j]=i;\n        }\n      }\n      return ans;\n    }\n};\n```
['Two Pointers', 'Bit Manipulation', 'C', 'C++']