This is the pseudocode o ur program
FUNCTION MinSubarrayLengthWithSum(arr, target_sum):
DECLARE left, right, current_sum, min_length
SET left = 0
SET current_sum = 0
SET min_length = infinity // A very large number
FOR right FROM 0 TO length(arr) - 1
// Expand the window by adding the rightmost element
SET current_sum = current_sum + arr[right]
// While the current sum meets or exceeds the target, shrink the window from the left
WHILE current_sum >= target_sum
// Update the minimum length found so far
SET current_length = right - left + 1
IF current_length < min_length
SET min_length = current_length
END IF
// Shrink the window by removing the leftmost element
SET current_sum = current_sum - arr[left]
SET left = left + 1
END WHILE
END FOR
// If min_length is still infinity, no valid subarray was found
IF min_length == infinity
RETURN 0
ELSE
RETURN min_length
END IF
END FUNCTION