SuperString
SRM 259 · 2005-08-22 · by Andrew_Lazarev
Problem Statement
We define the goodness of a string S as the number of letters that appear in S only once. For instance, the goodness of the string "CHALLENGE" is 5 because it contains 5 distinct letters 'C', 'H', 'A', 'N' and 'G'.
You are given a
Constraints
- superstring will have between 1 and 50 elements, inclusive.
- Each element of superstring will contain between 1 and 50 characters, inclusive.
- Each element of superstring will contain uppercase letters ('A'-'Z') only.
{"CHALLENGE"}
Returns: "CHALLENG"
{"THEWORD"}
Returns: "THEWORD"
{"THE", "MULTI", "LINE", "TEST"}
Returns: "HEMULTI"
{"ZYXWVUTSRQPONMLKJIHGFEDCBA", "ZYXWVUTSRQPONMLKJIHGFEDCBA"}
Returns: "AZYXWVUTSRQPONMLKJIHGFEDCB"
{"AK","A","E","J","C"}
Returns: "KAEJC"
Submissions are judged against all 97 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class SuperString with a public method string goodnessSubstring(vector<string> superstring) · 97 test cases · 2 s / 256 MB per case