Is this your company?
given array of integers. find subsequence that yields highest sum.
Anonymous
- start from array position 0 go all the way to end of array '\0' - Add the sum of each element with element + 1 position - Keep the sum stored as a int variable. - Check the sum value every time when you iterate thru the array - Now you got the highest sum from the array (but we don't know the position of the elements) - now again iterate, this time check for the position which matches the sum we previously calculate. Please cross check with your solution.
Check out your Company Bowl for anonymous work chats.