File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/main/java/g1001_1100/s1027_longest_arithmetic_subsequence Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ public int longestArithSeqLength(int[] nums) {
1515 for (int [] d : dp ) {
1616 Arrays .fill (d , 1 );
1717 }
18-
1918 int ans = 0 ;
2019 for (int i = 0 ; i < n ; i ++) {
2120 for (int j = i - 1 ; j >= 0 ; j --) {
@@ -27,29 +26,26 @@ public int longestArithSeqLength(int[] nums) {
2726 }
2827 }
2928 }
30-
3129 return ans ;
3230 }
3331
34- public int maxElement (int [] arr ) {
32+ private int maxElement (int [] arr ) {
3533 int max = Integer .MIN_VALUE ;
3634 for (Integer e : arr ) {
3735 if (max < e ) {
3836 max = e ;
3937 }
4038 }
41-
4239 return max ;
4340 }
4441
45- public int minElement (int [] arr ) {
42+ private int minElement (int [] arr ) {
4643 int min = Integer .MAX_VALUE ;
4744 for (Integer e : arr ) {
4845 if (min > e ) {
4946 min = e ;
5047 }
5148 }
52-
5349 return min ;
5450 }
5551}
You can’t perform that action at this time.
0 commit comments