Closed emnikhil closed 3 years ago
-->Method -- Use elements as Index and mark the visited places -->Approach:
Traverse the array.
While traversing, use the absolute value of every element as an index and make the value at this index as negative to mark it visited.
If something is already marked negative then this is the repeating element.
To find missing, traverse the array again and look for a positive value.
No issue no., Unable to check the issue assignment
-->Method -- Use elements as Index and mark the visited places -->Approach:
Traverse the array.
While traversing, use the absolute value of every element as an index and make the value at this index as negative to mark it visited.
If something is already marked negative then this is the repeating element.
To find missing, traverse the array again and look for a positive value.