Given two strings and . Create two new strings by exchanging the first half and second half of one of the strings with the first half and second half of the other string respectively.
Input : fighter warrior Output :warhter figrior Input :remuneration day Output :dration remuneay
In the first example, fighter is made up of two parts fig and hter. Similarly, warrior is also made up of two parts war and rior. Interchange the first part of both the strings to create two new strings warhter and figrior. Similarly, in the second example first part of remuneration which is remune is exchanged with the first part of day to create dration and remuneay.
- Check if both halves of the string have same set of characters
- Check if both halves of the string have same set of characters in Python
- Check if both halves of the string have at least one different character
- Create a new string by alternately combining the characters of two halves of the string in reverse
- Count of matchsticks required to represent the given number
- Program to implement FLAMES game
- C Program to concatenate two strings without using strcat
- Print characters in decreasing order of frequency
- Minimum number of additons to make the string balanced
- Extract all integers from the given string in Java
- Minimum number of substrings the given string can be splitted into that satisfy the given conditions
- Minimum length String with Sum of the alphabetical values of the characters equal to N
- C program to print the length of a String using %n format specifier
- Check whether two strings can be made equal by copying their characters with the adjacent ones
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : manishshaw1