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
What is %d used for?
in iso what are the common technological language?
Can we declare variables anywhere in c?
What is pragma in c?
In C language, a variable name cannot contain?
Why isnt any of this standardized in c?
Is calloc better than malloc?
What are shell structures used for?
Explain is it valid to address one element beyond the end of an array?
What does return 1 means in c?
What will be your course of action for a push operation?
Explain how do you declare an array that will hold more than 64kb of data?
Differentiate call by value and call by reference?
cavium networks written test pattern ..
What is a sequential access file?