public static void Main()
int[] nums = new int[]{3, 1, 2, 7, 4, 2, 1, 1, 5};
string output = MaxLength(nums, target).ToString();
Console.WriteLine(output);
int[] nums2 = new int[]{10, 5, 2, 6};
string output2 = MaxProduct(nums2, target2).ToString();
Console.WriteLine(output2);
int[] nums3 = new int[]{3, -1, 4, 12, -8, 5, 6};
string output3 = MaxProduct(nums3, target3).ToString();
public static int MaxLength(int[] nums, int target)
for(int right= 0; right < nums.Length; right++)
answer = Math.Max(answer, right - left + 1);
public static int MaxProduct(int[] nums, int limit)
for(int right= 0; right < nums.Length; right++)
answer += right - left + 1;
public static int FixedWindow(int[] nums, int target)
for (int i = 0; i < target; i++)