Substring Generation

Create a Python function that generates all specified-length substrings from a given string.

In Python, a substring is a consecutive sequence of characters from a larger string. This task involves creating a function named `generate_substrings(input_string, n)`. This function should generate all substrings of a specified length `n` from a provided string `input_string`. If substrings of the given length can't be created, the function should return `-1`. ### Parameters - `input_string`: A string to generate substrings from. - `n`: The desired length of the substrings. ### Return Value - The return value is a string that contains all substrings of length `n` from the input string. Each substring is separated by a comma. - If it isn't possible to produce a substring of such length, return `-1`. ### Examples ```python # No substring of length 5 can be generated from '1234' generate_substrings('1234',5) # Returns '-1' # Only one substring of length 2 can be created from '12' generate_substrings('12',2) # Returns '12' # Four substrings of length 6 can be created from '123456789' generate_substrings('123456789',6) # Returns '123456,234567,345678,456789' ```