Vrite a method that takes an array A of integers, and returns true if all the integers in the array are unique, id false if some integer appears more than once. For example, all Unique (X) would return true, since no ilue appears in X more than once, but all Unique (Y) would return false, since the value 200 appears more an once in array Y. X 0 1 50 19 2 3 200 34 4 5 0 87 Y 0 50 1 19 2 200 3 4 0 34 5 6 7 59 200 87

icon
Related questions
Question
requirement- The code expected to be relatively short, up to 10 lines
Vrite a method that takes an array A of integers, and returns true if all the integers in the array are unique,
id false if some integer appears more than once. For example, all Unique (X) would return true, since no
ilue appears in X more than once, but all Unique (Y) would return false, since the value 200 appears more
an once in array Y.
X
0
50
1
2
3
19 200 34
4
5
0 87
Y
0
50
1
2
19 200
3
34
4 5
0
6
7
59 200 87
Transcribed Image Text:Vrite a method that takes an array A of integers, and returns true if all the integers in the array are unique, id false if some integer appears more than once. For example, all Unique (X) would return true, since no ilue appears in X more than once, but all Unique (Y) would return false, since the value 200 appears more an once in array Y. X 0 50 1 2 3 19 200 34 4 5 0 87 Y 0 50 1 2 19 200 3 34 4 5 0 6 7 59 200 87
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer