File tree 1 file changed +4
-4
lines changed
src/main/java/g3101_3200/s3165_maximum_sum_of_subsequence_with_non_adjacent_elements 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
package g3101_3200 .s3165_maximum_sum_of_subsequence_with_non_adjacent_elements ;
2
2
3
3
// #Hard #Array #Dynamic_Programming #Divide_and_Conquer #Segment_Tree
4
- // #2024_06_02_Time_1927_ms_(87.75%)_Space_82.1_MB_ (5.31 %)
4
+ // #2024_06_04_Time_2046_ms_(85.84%)_Space_71.9_MB_ (5.09 %)
5
5
6
6
import java .util .stream .Stream ;
7
7
@@ -34,19 +34,19 @@ public Integer getMax() {
34
34
this .skipFirstSkipLast ,
35
35
this .skipFirstTakeLast )
36
36
.max (Integer ::compare )
37
- .orElse ( null );
37
+ .get ( );
38
38
}
39
39
40
40
public Integer skipLast () {
41
41
return Stream .of (this .takeFirstSkipLast , this .skipFirstSkipLast )
42
42
.max (Integer ::compare )
43
- .orElse ( null );
43
+ .get ( );
44
44
}
45
45
46
46
public Integer takeLast () {
47
47
return Stream .of (this .skipFirstTakeLast , this .takeFirstTakeLast )
48
48
.max (Integer ::compare )
49
- .orElse ( null );
49
+ .get ( );
50
50
}
51
51
}
52
52
You can’t perform that action at this time.
0 commit comments