Skip to content

Commit

Permalink
Added medium programming challenge with detailed problem statement, e…
Browse files Browse the repository at this point in the history
…xamples, and constraints.
  • Loading branch information
codez-bot[bot] authored Aug 19, 2023
1 parent 6354a58 commit d8eb0d5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions programming_interview/medium_challenge.md
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.

0 comments on commit d8eb0d5

Please sign in to comment.