How can you determine the shortest subarray that meets or exceeds a target sum from a given integer array, using a greedy algorithm?

Free for the first 3 answer contributors

Interview question asked to Machine Learning Engineers and Data Scientists interviewing at Kraken, ClassPass, Airtable and others: How can you determine the shortest subarray that meets or exceeds a target sum from a given integer array, using a greedy algorithm?.