Loading...
Loading...
Loading...
Two teachers each typed the answer key of a multiple-choice test as option numbers. Check whether the two keys are exactly the same: same length and the same option at every position.
SAME if the keys match exactly, otherwise DIFFERENT.Example 1
Input
4 1 3 2 4 4 1 3 2 4
Output
SAME
Every position matches.
Example 2
Input
3 1 2 3 3 1 3 2
Output
DIFFERENT
Same options but in a different order.
Try the problem first. Open one hint at a time.
== on two arrays only checks if they are the same object, not the same contents.
Arrays.equals(a, b) checks the length and every element for you.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor