Skip to content

Commit

Permalink
B_11656
Browse files Browse the repository at this point in the history
  • Loading branch information
likppi10 committed Oct 27, 2021
1 parent 4fad722 commit 28e7747
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Algorithm_Baek/Basic/B_203/B_11656_접미사배열.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package B_203_자료구조1참고;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class B_11656_접미사배열 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String word = br.readLine();
String[] words = new String[word.length()];

for(int i=0; i<word.length(); i++) words[i] = word.substring(i);
Arrays.sort(words);
for(int i=0; i<word.length(); i++) sb.append(words[i]+"\n");
System.out.println(sb);
}
}

0 comments on commit 28e7747

Please sign in to comment.