#51. 字符串偶数次出现统计
字符串偶数次出现统计
Append on Even Occurrences
Background
Congcong is facing a string processing challenge. He needs to extract strings with a specific pattern from an array of strings.
Problem Description
Loop over the given array of strings to build a result string. When a string appears the , , , etc. time in the array, append the string to the result. Return the empty string if no string appears a time.
Input Format
The input is given from standard input in the following format.
The input consists of a single line, representing an array of strings. Strings in the array are separated by spaces and enclosed in double quotes.
Output Format
Output to standard output in the following format.
Output a single string, which is the result string built according to the rules.
Sample
"a" "b" "a"
"a"
"a" "b" "a" "c" "a" "d" "a"
"aa"
"a" "" "a"
"a"
Sample Explanation
Sample 1 Explanation: The string "a" appears for the 1st time, not appended. The string "b" appears for the 1st time, not appended. The string "a" appears for the 2nd time, append "a" to the result. The final result is "a".
Sample 2 Explanation: The string "a" appears for the 1st time, not appended. The string "b" appears for the 1st time, not appended. The string "a" appears for the 2nd time, append "a" to the result. The string "c" appears for the 1st time, not appended. The string "a" appears for the 3rd time, not appended. The string "d" appears for the 1st time, not appended. The string "a" appears for the 4th time, append "a" to the result. The final result is "aa".
Sample 3 Explanation: The string "a" appears for the 1st time, not appended. The empty string "" appears for the 1st time, not appended. The string "a" appears for the 2nd time, append "a" to the result. The final result is "a".
Constraints
Time limit: second, Memory limit: KiB for each test case.