Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

CP WCC - Pascal version of Largest possible sum of consecutive numbers

Language: Layout:
+ ] Show input
Compilation time: 0.12 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,35 sec 
edit mode |  history
Largest possible sum of consecutive numbers
===========================================

For [ ] there are no sets

For [ -1 -2 -5 -4 -5 -1 -2 -11 ] there are no sets

For [ 1 2 5 4 5 1 2 11 ] there is one set
... the largest group is [ 1 2 5 4 5 1 2 11 ] with a sum of 31

For [ 1 2 -5 4 5 -1 2 -11 ] there is one set
... the largest group is [ 4 5 -1 2 ] with a sum of 10

For [ 1 2 4 -20 4 2 1 -15 3 2 2 ] there are multiple sets
... the largest group is [ 1 2 4 ] with a sum of 7
... the largest group is [ 4 2 1 ] with a sum of 7
... the largest group is [ 3 2 2 ] with a sum of 7

For [ 5 -5 5 -10 5 -5 5 ] there are multiple sets
... the largest group is [ 5 -5 5 ] with a sum of 5
... the largest group is [ 5 -5 5 ] with a sum of 5

For [ 5 -5 5 -5 5 ] there is one set
... the largest group is [ 5 -5 5 -5 5 ] with a sum of 5

For [ 5 5 -5 -6 ] there is one set
... the largest group is [ 5 5 ] with a sum of 10


    
                
λ
.NET NoSQL database for rapid development