# Exercises VI

## 1-bit and 2-bit Characters

[原题链接](https://leetcode.com/problems/1-bit-and-2-bit-characters/)

解法：greedy

```cpp
class Solution {
public:
    bool isOneBitCharacter(vector<int>& bits) {
        int i=bits.size()-2;
        while(i>=0&&bits[i]>0) i--;
        return (bits.size()-i)%2==0;
    }
};
```

## Can Place Flowers

[原题链接](https://leetcode.com/problems/can-place-flowers/)

