Your question is Longest Stable GPU Utilization Window. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an integer array utilization where each value represents GPU utilization percentage sampled over time, and an integer limit, return the length of the longest contiguous subarray in which the difference between the maximum and minimum values is less than or equal to limit. The input is a list of integers, and the output is a single integer.
def longest_stable_window(utilization, limit):