Iterate over the array. There are 4 cases:

- Current num is 0 and the cur_sum > 0
- Current num is 0 and cur_sum = 0
- Current num is 1 and cur_sum > 0
- Current num is 1 and cur_sum is Zero

```
public static bool IsOneBitCharacter(int[] bits)
{
int i = 0;
int cur_sum = 0;
int prev_sum = 0;
while (i < bits.Length)
{
if (bits[i] == 0)
{
if (cur_sum > 0)
{
prev_sum = cur_sum;
cur_sum = 0;
}
else
prev_sum = 0;
}
else
{
if (cur_sum > 0)
cur_sum = 0;
else
cur_sum += 1;
}
i++;
}
return prev_sum == 0;
}
```