
Let 'S' = "HelloWorld", N = 3.
The output should be "Hel", "loW ,"orl", "d".
The first line contains the string 'S'.
The second line contains the integer 'N'.
Return an array of strings, where each string is a segment of the original string 'S' of length 'N', except possibly the last one.
You don’t need to print anything. Just implement the given function.
1 <= length of 'S' <= 10^5
1 <= 'N' <= length of 'S'
'S' can contain numbers as well as letters
Time Limit: 1 sec
Approach:
Algorithm: