text: Number of cards needed build a House of Cards of a given level N | C # implementation of the above approach ; Function to find number of cards needed ; Driver Code
code: using System ; class GFG { public static int noOfCards ( int n ) { return n * ( 3 * n + 1 ) / 2 ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . Write ( noOfCards ( n ) ) ; } }