input: Write a python function to find the length of the longest subarray with a given sum.
  assert longest_subarray_with_sum([1, 2, 3, 4, 5], 9) == 2
  assert longest_subarray_with_sum([1, 2, 3, 4, 5], 5) == 2
  assert longest_subarray_with_sum([1, 1, 1, 1, 1], 3) == 3
  assert longest_subarray_with_sum([1, 2, 3, 7, 5], 12) == 2
  assert longest_subarray_with_sum([1, 2, 3, 4, 5], 15) == 5
output: def longest_subarray_with_sum(arr, target_sum):
      sum_map = {}
      current_sum = 0
      max_len = 0
  
      for i in range(len(arr)):
          current_sum += arr[i]
  
          if current_sum == target_sum:
              max_len = i + 1
  
          if current_sum - target_sum in sum_map:
              max_len = max(max_len, i - sum_map[current_sum - target_sum])
  
          if current_sum not in sum_map:
              sum_map[current_sum] = i
  
      return max_len