Skip to content

Commit 5526a9e

Browse files
committed
Runtime: 10 ms (Top 93.01%) | Memory: 44.8 MB (Top 13.42%)
1 parent 0a4c965 commit 5526a9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/B/Beautiful Arrangement/Beautiful Arrangement.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 10 ms (Top 93.01%) | Memory: 44.8 MB (Top 13.42%)
12
class Solution {
23
int N;
34
Integer[][] memo;
@@ -6,7 +7,7 @@ public int countArrangement(int n) {
67
memo = new Integer[n+1][1<<N];
78
return permute(1, 0);
89
}
9-
10+
1011
private int permute(int index, int mask)
1112
{
1213
if (mask == (1<<N)-1)
@@ -25,4 +26,4 @@ private int permute(int index, int mask)
2526
}
2627
return memo[index][mask]=res;
2728
}
28-
}
29+
}

0 commit comments

Comments
 (0)