write a program to read two string s1 and s2 and compare whether they are equal or not. join them together then copy the contents of s1 to s2. print and find the length of all the three string
Answers
Answered by
2
Answer:
Given two string S1 and S2, the task is to check whether both the strings can be made equal by performing the given operation on string S1. In a single operation, any character at an odd index can be swapped with any other character at an odd index, the same goes for the characters at even indices.
Examples:-
Input: S1 = “abcd”, S2 = “cbad”
Output: Yes
Swap ‘a’ and ‘c’ in S1 and the resultant
string is equal to S2.
Input: S1 = “abcd”, S2 = “abcdcd”
Output: No
HOPE IT HELP U DUDE......
Similar questions