Yahoo India Web Search

Search results

  1. Jul 5, 2024 · Given a 1-based indexing array arr [] of non-negative integers and an integer sum. You mainly need to return the left and right indexes (1-based indexing) of that subarray. In case of multiple subarrays, return the subarray indexes which come first on moving from left to right.

  2. Subarray Sum Equals K - 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.

  3. Step 1 - Take an array from the user of ' n ' elements; which refer to the non-negative integers in the main function. We can also take the sum value from the user to generate the result accordingly. Step 2 - Make a function call to find a subarray in which the sum of all the elements matches the given sum.

  4. Sep 20, 2022 · 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. Examples: Input: arr [] = {1, 4, 20, 3, 10, 5}, sum = 33. Output: Sum found between indexes 2 and 4. Explanation: Sum of elements between indices.

  5. 3 days ago · Subarray with Given Sum is a common problem in the field of algorithmic programming and data structures. It involves finding a contiguous subarray within a one-dimensional array whose elements sum up to a given target value. This problem arises in various scenarios, such as financial analysis, data processing, and algorithm optimization.

  6. Given an unsorted array arr of size n that contains only non negative integers, find a sub-array (continuous elements) that has sum equal to s. You mainly need to return the left and right indexes(1-based indexing) of that subarray.

  7. The problem statement is: Given an unsorted array of nonnegative integers, find a continous subarray which adds to a given number. Examples: Input: arr[] = {1, 4, 20, 3, 10, 5}, sum = 33. Ouptut: Sum found between indexes 2 and 4. Input: arr[] = {1, 4, 0, 0, 3, 10, 5}, sum = 7. Ouptut: Sum found between indexes 1 and 4.

  1. People also search for