yashvardhan-rustedlegend / Find-Subarray-with-given-Sum

Given an unsorted array of nonnegative integers, find a continuous sub-array that adds to a given number.

Repository from Github https://github.comyashvardhan-rustedlegend/Find-Subarray-with-given-SumRepository from Github https://github.comyashvardhan-rustedlegend/Find-Subarray-with-given-Sum

Find-Subarray-with-given-Sum

Given an unsorted array of nonnegative integers, find a continuous sub-array 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 Sum of elements between indices 2 and 4 is 20 + 3 + 10 = 33

Difficulty Level-Medium

About

Given an unsorted array of nonnegative integers, find a continuous sub-array that adds to a given number.

License:GNU General Public License v3.0


Languages

Language:C++ 100.0%