I'm new to Kotlin development and I'm trying to use kotlin standard functions like split,partition,chunked,windowed to solve this problem and understand them better
I have a ByteArray like this
[123, 34, 97, 3, 116, 3, 111, 110, 34, 58, 3, 112, 105, 110]
i need to split by 3 so the result should be
[123, 34, 94]
[116]
[111, 110, 34, 58]
[112, 105, 110]
Output:
Edit: added the following version with an array containing 1 million unsigned bytes.