Stream of Substrings!

0

0 votes
String manipulation, Easy
Problem

Given a string as an input. Write a program that will print all non-empty substrings of that given string.

Input:

The string

Output:

All substrings

Constraints:

1 ≤ N ≤ 103

Sample Input
abcd
Sample Output
a 
b
c
d
ab
bc
cd
abc
bcd
abcd
Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?