Re-solve the Round 2 coding question you could not pass: explain your approach and write pseudocode on paper.
Asked in the Technical interview stage.
For this exercise, implement longest_subarray_at_most_k_distinct(nums, k). Return the length of the longest contiguous subarray containing at most k distinct integers.
nums is a non-empty list of integers and k is a non-negative integer. Return an integer.
def longest_subarray_at_most_k_distinct(nums, k):