Noosik's friend Darwin has to submit an essay s quickly but his keyboard is broken. For some reason, everytime he hits enter, it will type a string z instead. Help Noosik create a program for Darwin to split the essay.
Implement split string function and malloc a 2D array to store the splitted string and return it. Don't forget to free the memory space that was previously allocated.
Hint: Be careful with the memory usage ! Dynamically allocate to avoid MLE
This is a partial judge program.
The first line is a string s, that needs to be splitted.
The second line is a string z, that needs to be replaced.
20 < s < 500
1 < z < 10
Output the strings splitted by z followed by '\n' at the end of each splitted string.