C++ Strings
School Accuracy: 82.82% Submissions: 4225 Points: 0

Given two strings  S1 and S2 . You have to concatenate both the strings and print the concatenated string.

Example 1:

Input:
S1 = "Geeksfor"
S2 = "Geeks"
Output: GeeksforGeeks
Explanation: Combined "Geeksfor" and "Geeks"

 

Example 2:

Input:
S1 = "Practice"
S2 = "Hard"
Output: PracticeHard
Explanation: Combined "Practice" and "Hard"

 

Your Task:  
You dont need to read input or print anything. Complete the function conCat() which accepts two strings S1 and S2 as input parameter and returns concatenated string.


Expected Time Complexity: O(|S1| + |S2|) .
Expected Auxiliary Space: O(|S1| + |S2|) .
where N is the length of a String


Constraints:
1 <= |S1| , |S2| <= 105

|S| denotes the length of the string S.

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

C++ Strings

Output Window