Skip to content

Commit ebc9c7b

Browse files
committed
Add C++ solution of problem #2579
1 parent e5b4c21 commit ebc9c7b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

2579/solution.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)