Write a program that accepts two sets of alpha-numeric characters and performs an efficient matching between them. Finally, display the results.
The intent of this challenge is to play with set theory. Avoid using pre-built framework functions that perform this work in a single line of code. Instead, illustrate how you would efficiently operate with two sets of data when trying to match values between them.
There are many ways to approach this algorithm so be creative.
Input:
Two lines of input, each with a space-delimited series of values that represent the two sets.
Output:
The set of values that exist in both input sets sorted alpha-numerically.
If no common values exist, output NULL
.
꒰ chizzy_elect ꒱ؘ SHINE!࿐ ࿔*:・゚
Example 1:
Input: set1 = ["1", "2", "3", "A", "B", "C"], set2 = ["X", "11", "G", "M", "2", "9", "3", "C", "N", "R"]
Output: "2 3 C"
Explanation:An educated guess -The values
2
,3
, andC
are present in both sets. After sorting them alpha-numerically, the output is2 3 C
.
🍉🍉

input:
output: