We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5b4c21 commit ebc9c7bCopy full SHA for ebc9c7b
2579/solution.cpp
@@ -0,0 +1,9 @@
1
+class Solution {
2
+public:
3
+ long long coloredCells(int n) {
4
+ long long ans = 1;
5
+ for(int i = 2; i <= n; i++)
6
+ ans += (i * 4) - 4;
7
+ return ans;
8
+ }
9
+};
0 commit comments