count-total-number-of-colored-cells
1.0.0
Count Total Number of Colored Cells
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
#include <bits/stdc++.h>
2
3
using namespace
std;
4
5
class
Solution
6
{
7
public
:
8
long
long
coloredCells
(
int
n)
9
{
10
long
long
m = n;
11
return
(m * m) + ((m - 1) * (m - 1));
12
}
13
};
14
15
int
main
()
16
{
17
cout <<
"output: "
<<
Solution
().
coloredCells
(3) <<
'\n'
;
18
return
0;
19
}
Solution
Definition
main.cpp:6
Solution::coloredCells
long long coloredCells(int n)
Definition
main.cpp:8
main
int main()
Definition
main.cpp:15
main.cpp
Generated by
1.9.8