Question: Find Doubles This coding exercise is worth a total of 1 0 points, each test is worth one point. Given a list of N integers,

Find Doubles
This coding exercise is worth a total of 10 points, each test is worth one point.
Given a list of N integers, not necessarily unique, find all elements of the list for which there exists exactly one element of the list which is twice that number. The integers range from 0 to 1000. The list has no more than 100,000 elements.
Your code should find the appropriate values and print them to STDOUT in sorted order.
Examples:
1,2,3,4,5,6,7,8,9,0,8,,0,1,2,3
(8 is 4***2, but 8 is present twice; 0 is its own double, so it's part of the result)
71711123
(nothing is exactly twice another element)
1,1211
(1 and 1 both have their double 2 present, and 2 is present in the list only once)
 Find Doubles This coding exercise is worth a total of 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!