The problem of finding the longest subarray with a given sum is a common coding challenge. Given an array arr[] of integers (which can include both positive and negative numbers) and an integer k, our task is to find the length of the longest contigu...