Help Needed in CSES Shortest Subsequence Problem

Правка en3, от SEH_LENGE_THODA, 2020-11-13 15:18:27

Can anyone suggest me how to solve this problem(https://cses.fi/problemset/task/1087)

You are given a DNA sequence consisting of characters A, C, G, and T.

Your task is to find the shortest DNA sequence that is not a subsequence of the original sequence.

Input

The only input line contains a DNA sequence with n characters.

Output

Print the shortest DNA sequence that is not a subsequence of the original sequence. If there are several solutions, you may print any of them.

Constraints 1≤n≤1e6 Example

Input: ACGTACGT

Output: AAA

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский SEH_LENGE_THODA 2020-11-13 15:18:27 2 Tiny change: 'nts\n1≤n≤106\nExample' -> 'nts\n1≤n≤1e6\nExample'
en2 Английский SEH_LENGE_THODA 2020-11-13 15:18:03 2 Tiny change: 'sk/1087)\nYou are ' -> 'sk/1087)\n\nYou are '
en1 Английский SEH_LENGE_THODA 2020-11-13 15:17:36 606 Initial revision (published)