please assist me to solve this problem

26 views
Skip to first unread message

Avinash Gupta

unread,
Sep 6, 2016, 3:15:45 AM9/6/16
to Ruby on Rails: Talk

Write a RoR program to find the contiguous subarray within a onedimensional
array of
numbers (containing at least one positive number) which has the largest sum. For example,
for the sequence of values −2, 1, −3, 4, −1, 2, 1, −5, 4; the contiguous subarray with the
largest sum is 4, −1, 2, 1, with sum 6.
The program should run as follows <bold is user entry>:
Enter the array : 2
1 3
4 1
2 1 5
4
Largest SubArray
Start Index: 3
Length: 4
Sum: 6
Elements: 4 1
2 1

kindly assist me to solve the problem

Colin Law

unread,
Sep 6, 2016, 3:36:33 AM9/6/16
to Ruby on Rails: Talk
It is unlikely that you will get anyone to help with your course work
if you just copy/paste the requirement here. If you try to do it
yourself but come across a particular issue that you would like help
with then I am sure someone will help.

Colin
Reply all
Reply to author
Forward
0 new messages