Loading...
Loading...
Loading...
Order ids should be unique. Read the ids one by one and find the first id that has already appeared before. Print that id, or NONE if all ids are different.
NONE.Example
Input
5 101 102 103 101 102
Output
101
101 is the first number that appears a second time; 102 repeats later.
Try the problem first. Open one hint at a time.
put returns the old value, or null when the key was new.
Stop at the first id for which put does not return null.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor