leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };