You are not logged in. Please login at to post your questions!



This problem can be solved by using a priority queue.

My solution :

Idea is keep a pointer from each element to the last element , and decrement the pointer to the previous element if the subbarray sum is popped out.

To do this we can use a priority queue , pop out and print the largest sum and then modify the pointer and push it back to the queue.

asked 30 Apr '16, 23:09

geek_geek's gravatar image

accept rate: 16%

Answer is hidden as author is suspended. Click here to view.

answered 30 Apr '16, 23:16

sampatghosh's gravatar image

accept rate: 12%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 30 Apr '16, 23:09

question was seen: 1,054 times

last updated: 30 Apr '16, 23:16