class Solution { public: bool isOneBitCharacter(vector<int>& bits) { int len = bits.size(); if (len == 1) { if (bits[0] == 0) { return true; } else { return false; } } for (int i = 0; i < len; i++) { if (i == len - 1 && bits[i] == 0) { return true; } if (bits[i] == 0) { continue; } if (bits[i] == 1) { i++; continue; } } return false; } };