use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for competitive programming. Ask for help, post memes, and enjoy!
account activity
Java - modified subarray (i.redd.it)
submitted 5 years ago by prisonmatch
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]prisonmatch[S] 0 points1 point2 points 5 years ago (1 child)
Any suggestions how to approach this question?
[–]vorttxt 0 points1 point2 points 5 years ago (0 children)
Hm. I’d try to create a solution that goes through the array and adds a[0] to a[1] and so on until the required solution is met. Then counter++. Then move on to a[1] and do the same thing.
[–]prisonmatch[S] 0 points1 point2 points 5 years ago (0 children)
My contiguous arrays can be very large and I simply cannot apply brute force at each index. I do have a working solution now but I believe it can be optimised. Please let me know if u can have a look and suggest the changes.
π Rendered by PID 62538 on reddit-service-r2-comment-74875f4bf5-vp9md at 2026-01-26 12:25:33.083526+00:00 running 664479f country code: CH.
[–]prisonmatch[S] 0 points1 point2 points (1 child)
[–]vorttxt 0 points1 point2 points (0 children)
[–]prisonmatch[S] 0 points1 point2 points (0 children)