Given an integer array and k, find the longest contiguous subarray where no element appears more than k times.
Asked in the Round 1 stage.
Implement longest_subarray(nums, k) and return the maximum length. The array may contain positive, zero, or negative integers.
def longest_subarray(nums, k):