Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 567 Bytes

ms0001.md

File metadata and controls

23 lines (14 loc) · 567 Bytes

Beautiful String

If a string contains three or more groups of ascending characters with each group has the same length, we call it a beautiful string (2014 MS)

  • beautiful strings: abc, cde, aabbcc, aaabbbccc
  • non-beautiful strings: abd, cba, aabbc, zab

input:

  1. the first line is the number of cases
  2. every line after the first line is a number and a string
  3. the number is the length of the string, which is less than 10 MB

output: YES / NO

constains:

  1. input only contains non-capital characters

Source Code

  1. fsm-solution