Pergunta de entrevista da empresa Amazon

Given an array of integers, find the longest subarray with a given sum.