FastPrepFastPrep
Problem Brief

John Venn (Analyst Program :)

FULLTIMEOA

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!࿐ ࿔*:・゚

1Example 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, and C are present in both sets. After sorting them alpha-numerically, the output is 2 3 C.

Constraints

Limits and guarantees your solution can rely on.

🍉🍉
public String matchSets(String[] set1, String[] set2) {
  // write your code here
}
Input

set1

["1", "2", "3", "A", "B", "C"]

set2

["X", "11", "G", "M", "2", "9", "3", "C", "N", "R"]

Output

"2 3 C"

Sign in to submit your solution.