- one way was to get the product and then check the size of bits.
- but this would ended up in TLE.
- since we only need size of bit in the end.
- therefore taken
log with base 2
.
int multipleLength(vector<int> &arr, int n) {
double ans = 0;
for (int i = 0; i < n; i++) {
ans += (double)log2(arr[i]);
}
int result = (int)(ans) + 1;
return result;
}