This commit is contained in:
2025-11-18 16:04:55 +08:00
parent 2971e19529
commit a1094d0d17
3 changed files with 95 additions and 0 deletions

19
25/11/717.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include <vector>
bool isOneBitCharacter(std::vector<int> &bits) {
bool tag = true;
int n = bits.size();
for (int i = 0; i < n; i++) {
if (tag && bits[i] == 1) {
tag = false;
continue;
}
if (tag && bits[i] == 0) {
continue;
}
if (i != n - 1) {
tag = true;
}
}
return tag;
}