From 957065ecbf046a5ed846ca85e6cd79d606641d09 Mon Sep 17 00:00:00 2001 From: Amit S Sahu Date: Mon, 21 Oct 2024 11:25:38 +0530 Subject: [PATCH] Create README - LeetHub --- 0287-find-the-duplicate-number/README.md | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 0287-find-the-duplicate-number/README.md diff --git a/0287-find-the-duplicate-number/README.md b/0287-find-the-duplicate-number/README.md new file mode 100644 index 0000000..ba4e856 --- /dev/null +++ b/0287-find-the-duplicate-number/README.md @@ -0,0 +1,44 @@ +

287. Find the Duplicate Number

Medium


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 in nums, return this repeated number.

+ +

You must solve the problem without modifying the array nums and using only constant extra space.

+ +

 

+

Example 1:

+ +
+Input: nums = [1,3,4,2,2]
+Output: 2
+
+ +

Example 2:

+ +
+Input: nums = [3,1,3,4,2]
+Output: 3
+
+ +

Example 3:

+ +
+Input: nums = [3,3,3,3,3]
+Output: 3
+ +

 

+

Constraints:

+ + + +

 

+

Follow up:

+ +