JavaScript
\nvar smallestSubarrays = function (nums) {\n  const n = nums.length;\n\n  const res = Array(n).fill(0);\n\n  const last = Array(32).fill(0);\n\n  for (let i = 
```\nvar smallestSubarrays = function (nums) {\n  const n = nums.length;\n\n  const res = Array(n).fill(0);\n\n  const last = Array(32).fill(0);\n\n  for (let i = n - 1; i >= 0; i--) {\n    res[i] = 1;\n\n    for (let j = 0; j < 32; j++) {\n      if (nums[i] & (1 << j)) {\n        last[j] = i;\n      }\n      res[i] = Math.max(res[i], last[j] - i + 1);\n    }\n  }\n\n  return res;\n}\n```
['JavaScript']