Given two same length strings str1 and str2 consisting of lowercase English alphabets, the task is to find the Mid-Alphabet for each index of the given pair of Strings.
Input: str1 = “abcd”, str2 = “cdef”
b is mid of a and c
c is mid of b and d
d is mid of c and e
e is mid of e and f
Input: str1 = “akzbqzgw”, str2 = “efhctcsz”
Below is the implementation of the above approach:
Time Complexity: , where N is the length of the String.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- A Program to check if strings are rotations of each other or not
- Given a string, find its first non-repeating character
- Find the smallest window in a string containing all characters of another string
- Check whether two strings are anagram of each other
- Print all interleavings of given two strings
- Interleaving of two given strings with no common characters
- Given a number, find the next smallest palindrome
- Find if a string is interleaved of two other strings | DP-33
- Find the first non-repeating character from a stream of characters
- Find Excel column name from a given column number
- Given a sorted dictionary of an alien language, find order of characters
- Find if an array of strings can be chained to form a circle | Set 1
- Given two strings, find if first string is a subsequence of second
- Print all possible strings that can be made by placing spaces
- Find if a given string can be represented from a substring by iterating the substring “n” times
- Find all distinct palindromic sub-strings of a given string
- Find maximum depth of nested parenthesis in a string
- Function to find Number of customers who could not get a computer
- Find the longest substring with k unique characters in a given string
- Check if two given strings are isomorphic to each other
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.