3
bool validUtf8(vector<int> &data) {6
for (int i = 0; i < n; i++) {9
// if the first 3 bits are 110, then the next byte is part of the10
// current UTF-8 character11
if ((ele >> 5) == 0b110) count = 1;12
// if the first 4 bits are 1110, then the next 2 bytes are part of the13
// current UTF-8 character14
else if ((ele >> 4) == 0b1110)16
// if the first 5 bits are 11110, then the next 3 bytes are part of the17
// current UTF-8 character18
else if ((ele >> 3) == 0b11110)20
// if the first bit is 1, then return false24
// if the first 2 bits are not 10, then return false25
if ((ele >> 6) != 0b10) return false;