text: Number of coloured 0 's in an N | C ++ implementation of the approach ; Function to return the count of coloured 0 s in an n - level hexagon ; Driver code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int count ( int n ) { return n * ( 3 * n - 1 ) / 2 ; } int main ( ) { int n = 3 ; cout << count ( n ) ; return 0 ; }