About 907,000 results
Open links in new tab
  1. Find subarrays with a given sum in an array | Techie Delight

    Sep 12, 2025 · Given an integer array, find subarrays with a given sum in it. Please note that the problem specifically targets subarrays that are contiguous and inherently maintains the order of …

  2. Subarray with Given Sum - GeeksforGeeks

    Jul 23, 2025 · So to check if there is a subarray with a sum equal to target, check for every index i, and sum up to that index as currSum. If there is a prefix with a sum equal to (currSum – target), then the …

  3. Subarray Sum Equals K - LeetCode

    Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. A subarray is a contiguous non-empty sequence of elements within an array.

  4. Algorithm to Find All Subarrays With a Given Sum K

    Mar 18, 2024 · A quick and practical guide to the problem of finding the number of subarrays with a given sum K.

  5. Subarray with Given Sum: Codes with Visualization

    Oct 3, 2025 · Learn how to find a subarray with a given sum using brute force and optimized sliding window approaches, with Python, C++, and Java code examples and visualization.

  6. Subarray with given sum in Java with different approaches

    Aug 14, 2024 · In this article, we'll explore multiple approaches to solving the problem of finding a subarray with a given sum in Java. Given an array of integers and a target sum, find a continuous …

  7. Subarray with given sum - Tpoint Tech - Java

    Mar 17, 2025 · In this problem, we are provided with an unsorted array of non-negative integers and a sum integer value. We need to find the part from the array, or can we need to find the Subarray, in …

  8. Find a subarray having the given sum in an integer array

    Sep 15, 2025 · Given an integer array, find a subarray having a given sum in it. We can solve this problem by using a sliding window. The idea is to maintain a window that starts from the current …

  9. C Program to Find Subarray with Given Sum in C

    Jul 9, 2024 · Given an array of integers and a target sum, find a continuous subarray that adds up to the target sum. If such a subarray exists, return the starting and ending indices of the subarray. If no …

  10. Subarray with Given Sum - Handles Negative Numbers

    Mar 6, 2025 · Given an unsorted array of integers, find a subarray that adds to a given number. If there is more than one subarray with the sum of the given number, print any of them.