Thank you for your helpful answer! Consider the following method: bool hasDuplicates(int V[], int n) {for (int i=0; i Solution 1) So we can see that the total number of times the sequence of statements executes is: N + N-1 + N-2 + ... + 3 + 2 + 1. the total is O(N2). 2) Use count array to store frequency of each element in an array traverse the entire array and find maximum element create an array with size of maximum element and instantiate to zero now traverse count array and see if it has value 2 for any index if it has then array has duplicates else no O(n) complexityValue of iNumber of iterations of inner loop0N1N-12N-2......N-22N-11.