Given an array of length N containing integers between 1
and N, determine if it contains any duplicates.
Answer Posted / ash
If the question is just to find just whether there are
duplicates in the array, we can just sum all the numbers
and if the sum is less than n(n+1)/2, some number in the
array has repeated.
Is This Answer Correct ? | 8 Yes | 39 No |
Post New Answer View All Answers
Which one would you prefer - a macro or a function?
What is meant by errors and debugging?
What are high level languages like C and FORTRAN also known as?
What is the role of && operator in a program code?
How do I use strcmp?
Write a program on swapping (100, 50)
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Did c have any year 2000 problems?
Write a program to find factorial of a number using recursive function.
how to find anagram without using string functions using only loops in c programming
What is the -> in c?
can we change the default calling convention in c if yes than how.........?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
Is fortran still used in 2018?
What are qualifiers in c?