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;
}
'알고리즘 > codefights' 카테고리의 다른 글
19>rangeBitCount (0) | 2021.04.17 |
---|---|
17>Kill K-th Bit (0) | 2021.04.17 |
Challenge>formatString (0) | 2019.03.06 |
Challenge>fibonacciIndex (0) | 2019.03.06 |
16>metroCard (0) | 2019.02.24 |