본문 바로가기
Algorithm

[알고리즘] 접미사 배열 백준 11656 (Python)

by 가영리 2022. 1. 17.
728x90

코드

import sys

str = sys.stdin.readline().rstrip()
arr = []

for i in range(len(str)):
  arr.append(str)
  str = str[1:]

arr.sort()

for i in arr:
  print(i)

 

입출력