subject

Given an array of integers and the size of the array, write a function findDuplicate which prints the duplicate element from the array. The array consists of all distinct integers except one which is repeated. Find and print the repeated number. If no duplicate is found, the function should print -1. Your function has two parameters in the order: an array of type int the number of elements in the array the function does not return anything

Example 1:
Given array: {2,3,5,6,11,20,4,8,4,9}
Output: 4

Example 2:
Given array: {1,3,5,6,7,8,2,9}
Output: -1

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Choose the correct citation for the case which established the "minimum contacts" test for a court's jurisdiction in a case. select one: a. brown v. board of education of topeka, 347 u.s. 483 (1954). b. international shoe co. v. washington, 326 u.s. 310 (1945) c. haynes v. gore, 531 u.s. 98 (2000). d. international shoe co. v. washington, 14 u.s. code 336.
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
Craig keeps missing important staff meetings and getting double-booked for appointments. craig should use scheduling software a database diagramming software a word processor
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Amisfire code is a type diagnostic trouble code (dtc).
Answers: 1
You know the right answer?
Given an array of integers and the size of the array, write a function findDuplicate which prints th...
Questions
question
Mathematics, 29.09.2019 08:00
question
Health, 29.09.2019 08:00
question
Mathematics, 29.09.2019 08:00
Questions on the website: 13722363