Count of 0 s in an N | Java implementation of the above approach ; Function to return the count of 0 s in an n - level hexagon ; Driver code
class GFG { static int count ( int n ) { return 3 * n * ( n - 1 ) + 1 ; } public static void main ( String args [ ] ) { int n = 3 ; System . out . println ( count ( n ) ) ; } }