fork download
  1. #include <set>
  2. #include <string>
  3. using namespace std;
  4. class TopFox{
  5. public:
  6. int possibleHandles(string familyName, string givenName){
  7. set<string> a;
  8. for( int i=1; i<=familyName.size(); i++ ){
  9. for( int j=1; j<=givenName.size(); j++ ){
  10. string s = familyName.substr( 0, i ) + givenName.substr( 0, j );
  11. a.insert( s );
  12. }
  13. }
  14. return a.size();
  15. }
  16. };
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty