18>arrayPacking
You are given an array of up to four non-negative integers, each less than 256. |
code>>
int arrayPacking(vector<int> a) {
auto result = 0;
for(int i=0; i< a.size(); ++i)
{
result += a[i] << i * 8;
}
return result;
}
You are given an array of up to four non-negative integers, each less than 256. |
code>>
int arrayPacking(vector<int> a) {
auto result = 0;
for(int i=0; i< a.size(); ++i)
{
result += a[i] << i * 8;
}
return result;
}