Python Program that Displays Letters that are not common in two strings
Given two strings. write a Python program to find which letters are in the two strings but not in both.
Input: india australia Output: s t r n d u l
Steps to be performed:
- Take two string inputs and store them in different variables.
- Convert them into a set and look for letters inside in two strings but not in both.
- Store those letters in a different list.
- Print that list.
Below is the implementation of the above approach:
The letters are: r v t h a
Time Complexity: O(n)
Auxiliary Space: O(n)