Skip to content

Commit cf4f922

Browse files
committed
Runtime 75 ms (Top 78.95%) | Memory 42.0 MB (Top 42.11%)
1 parent af550a8 commit cf4f922

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/algorithms/P/Painting a Grid With Three Different Colors/Painting a Grid With Three Different Colors.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Runtime: 90 ms (Top 77.11%) | Memory: 54.6 MB (Top 39.76%)
2-
class Solution
1+
class Solution
32
{
43
static int mod=(int)(1e9+7);
54
public static int dfs(int n,ArrayList<ArrayList<Integer>> arr,int src,int dp[][])
@@ -56,7 +55,7 @@ public int colorTheGrid(int m, int n)
5655
{
5756
adj.add(new ArrayList<Integer>());
5857
}
59-
58+
6059
for(int i=0;i<adj.size();i++)
6160
{
6261
for(int j=0;j<arr.size();j++)
@@ -78,6 +77,6 @@ public int colorTheGrid(int m, int n)
7877
sum12=(sum12%mod+dfs(n-1,adj,i,dp)%mod)%mod;
7978
}
8079
return sum12;
81-
80+
8281
}
8382
}

0 commit comments

Comments
 (0)