Home > Back-end >  Looking for a beautiful string... Pray god give directions
Looking for a beautiful string... Pray god give directions

Time:11-10

When all individual or group character within the string "continuous" or "repeat", and the number of continuous or repeated three times or more, then we call such a string string "beautiful", such as string "ABC" (single) in a row, "aabbccdd (group) in a row," "BBBB" repeated (single), "acacac" (group) are beautiful string, and like the string "abce", "aabbcdd", "BBBF", etc., are not beautiful string,
Sometimes a long string of characters as a whole, not beautiful string, but it might hide inside a beautiful "string", "abce" string as stated earlier, inside there is a beautiful substring "ABC",
Existing "input. TXT" a text file, there are several lines of string (the length of the string in a row is not more than 128), now requires:
According to find lines of the "beautiful substring" inside the string, and will find the results according to the line of the output to a file "output. TXT", and mark the original string at the beginning of each row in the number of rows in the original file, the requirement to find beautiful substring, as long as possible to the,
If the file first line string is:
Aaabbbcccdddef
The output is:
, Line1: aaabbbcccddd def
  • Related