-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added medium programming challenge with detailed problem statement, e…
…xamples, and constraints.
- Loading branch information
1 parent
6354a58
commit d8eb0d5
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Medium Programming Challenge | ||
|
||
## Problem Statement | ||
Write a function `find_longest_subarray` that takes a list of integers and returns the length of the longest contiguous subarray that contains only unique elements. | ||
|
||
## Input/Output Specifications | ||
- Input: | ||
- A list of integers `nums` (1 <= len(nums) <= 10^5) where -10^4 <= nums[i] <= 10^4. | ||
- Output: | ||
- An integer representing the length of the longest contiguous subarray with unique elements. | ||
|
||
## Examples | ||
- Input: [1, 2, 3, 4, 5] | ||
Output: 5 | ||
|
||
- Input: [1, 2, 2, 3, 4] | ||
Output: 3 | ||
|
||
- Input: [5, 5, 5, 5, 5] | ||
Output: 1 | ||
|
||
## Constraints | ||
- The list will have at least one integer. | ||
- The solution should have a time complexity of O(n), where n is the length of the input list. |