Skip to content

Commit 40b1eb2

Browse files
committed
Runtime: 1 ms (Top 71.82%) | Memory: 41.2 MB (Top 34.16%)
1 parent 7b12e00 commit 40b1eb2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
// Runtime: 1 ms (Top 71.82%) | Memory: 41.2 MB (Top 34.16%)
12
class Solution {
23
public int getMaximumGenerated(int n) {
34
if(n==0 || n==1) return n;
4-
5+
56
int nums[]=new int [n+1];
6-
7+
78
nums[0]=0;
89
nums[1]=1;
910
int max=Integer.MIN_VALUE;
10-
11+
1112
for(int i=2;i<=n;i++){
1213
if(i%2==0){
1314
nums[i]=nums[i/2];
@@ -19,4 +20,4 @@ public int getMaximumGenerated(int n) {
1920
}
2021
return max;
2122
}
22-
}
23+
}

0 commit comments

Comments
 (0)