Marks :10
: 3 | : 0
Given an array of integers $$$nums$$$ containing $$$n$$$ + $$$1$$$ integers where each integer is in the range $$$[1, n]$$$ inclusive.
There is only one repeated number that occurs twice in $$$nums$$$, return this repeated number.
Try to solve the problem without modifying the array $$$nums$$$ and using only constant extra space.
The first line contains an integer $$$n$$$. The second line contains $$$n$$$ + $$$1$$$ integers where each integer is in range $$$1$$$ to $$$n$$$.$$$(1 \le n \le 10^5).$$$
Output a single integer that is repeated.
3 1 2 3 3
3
4 1 2 1 4 3
1
7 1 2 3 4 5 6 7 4
4
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.