diff --git a/programming_interview/medium_challenge.md b/programming_interview/medium_challenge.md new file mode 100644 index 0000000..f9a2ea9 --- /dev/null +++ b/programming_interview/medium_challenge.md @@ -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.