LeetCode1-bit and 2-bit Characters1-bit and 2-bit CharactersEasyArraySolution export function isOneBitCharacter(bits: number[]): boolean { const n = bits.length; let currentIndex = 0; while (currentIndex < n) { if (currentIndex === n - 1) { return true; } currentIndex += bits[currentIndex] === 1 ? 2 : 1; } return false; }LeetCode1-bit and 2-bit Charactershttps://leetcode.com/problems/1-bit-and-2-bit-characters