Task: Split String into Segments of N Characters
Task: Split String into Segments of N Characters: a task in Terminal-Lego-15k (Harbor dataset). You need to implement a JavaScript solution that splits a string into an array of segments, where each segment contains exactly n characters. The last segment may contain fewer characters if the string…
The task
You need to implement a JavaScript solution that splits a string into an array of segments, where each segment contains exactly `n` characters. The last segment may contain fewer characters if the string length is not evenly divisible by `n`.
Part of PrimeIntellect/Terminal-Lego-15k.