C# individual bits queue
\npublic int[] SmallestSubarrays(int[] nums)\n{\n\tvar bits = Enumerable.Range(0, 32).Select(_ => new Queue<int>()).ToArray();\n\tfor (int i = 0; i < nums.Lengt
```\npublic int[] SmallestSubarrays(int[] nums)\n{\n\tvar bits = Enumerable.Range(0, 32).Select(_ => new Queue<int>()).ToArray();\n\tfor (int i = 0; i < nums.Length; i++)\n\t{\n\t\tvar n = nums[i];\n\t\tint bidx = 0;\n\t\twhile (n > 0)\n\t\t{\n\t\t\tif ((n & 1) > 0)\n\t\t\t\tbits[bidx].Enqueue(i);\n\t\t\tn >>= 1;\n\t\t\tbidx++;\n\t\t}\n\t}\n\n\tfor (int i = 0; i < nums.Length; i++)\n\t{\n\t\tvar max = 1;\n\t\tfor (int j = 0; j < bits.Length; j++)\n\t\t{\n\t\t\twhile (bits[j].TryPeek(out var idx) && idx < i)\n\t\t\t\tbits[j].Dequeue();\n\t\t\tif (bits[j].Count > 0)\n\t\t\t\tmax = Math.Max(max, bits[j].Peek() - i + 1);\n\t\t}\n\t\tnums[i] = max;\n\t}\n\treturn nums;\n}\n```
[]