Redirecting to
NADOS

Lexicographical Suffixes

Given a string, print all suffixes of it in lexicographical order.
Input Format
A string S.
Output Format
Print |S| lines, each having a suffix.
Question Video
Constraints
|S| <= 10^5
Sample Input
bananaban
Sample Output
aban
an
anaban
ananaban
ban
bananaban
n
naban
nanaban


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name