0717.cpp (254B)
1 class Solution { 2 public: 3 bool isOneBitCharacter(const vector<int> &bits) const { 4 int last = -2; 5 6 for (int i = 0; i < size(bits); i++) { 7 if (bits[i]) last = i++; 8 } 9 10 return last != size(bits) - 2; 11 } 12 };