Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Read the data integer by integer. When you read it, process the least significant 8 bits of it.
Assume the next encoding is 1-byte data. If it is not 1-byte data, read the next integer and assume it is 2-bytes data.
Similarly, if it is not 2-bytes data, try 3-bytes then 4-bytes. If you read four integers and it still does not match any pattern, return false.