1-bit and 2-bit Characters Solutions in PythonNumber 717Difficulty EasyAcceptance 48.7%Link LeetCodeOther languages C++, GoSolutionsPython solution by haoel/leetcodedef isOneBitCharacter(self, bits): i = 0 while i < len(bits): if bits[i] == 0: i += 1 if i >= len(bits): return True if bits[i] == 1: i += 2 if i >= len(bits): return False if i == len(bits) - 1: return Truedef isOneBitCharacter(self, bits): i = 0 while i < len(bits): if bits[i] == 0: i += 1 if i >= len(bits): return True if bits[i] == 1: i += 2 if i >= len(bits): return False if i == len(bits) - 1: return True