Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Why are you spoiling the kata like that? Please don't.
This comment is hidden because it contains spoiler information about the solution
You are not checking every position of subarrays, instead of defining a fixed lookahead value, how about considering tracking previous accumulations and denote a logic to compute local maxima and global maxima?
When
i
is equal toarr.size() - 2
thenj
will becomearr.size() - 1
, but it will not enter the 2nd inner loop due to the condition here -->j < arr.size() - 2
.Also, your code will timeout because its time complexity is O(N^2) whereby an O(N) approach should suffice.
Read the description carefully
kata hint / knowledge sharing != kata suggestion.
In other words, it means
[]
should return0
, since there is nothing to sum against.This is a wonderful kata! And much easier than it looks like, haha
Shortcat reference???
Fixed
Approved fork
I've just copied your code and it passed the tests, probably due to more updated Java versions (faster time complexity), closing
Fixed by OP
Approved
python new test framework is required. updated in this fork
Loading more items...