Home > Back-end > As soon as possible find out N appears only once in the array number and several other random number
As soon as possible find out N appears only once in the array number and several other random number
Time:09-17
It into a final exam to find two appears only once in the array number, I'll expand this problem, is there any way to find out as soon as possible find out N appears only once in the array number, I check to baidu baidu's day an interview, just like I didn't want to, I want to own a two methods all have no success, Seek solutions,
CodePudding user response:
I don't know the stupid way, as soon as possible,
CodePudding user response:
What's the idea
CodePudding user response:
N array string into a new array, quick sort, scanning array by adjacent element (an element and elements are different before and after) you can judge only once,