Count triangles required to form a House of Cards of height N | Function to find required number of triangles ; Driver Code ; Function call
def noOfTriangles ( n ) : NEW_LINE INDENT return n * ( n + 2 ) * ( 2 * n + 1 ) // 8 NEW_LINE DEDENT n = 3 NEW_LINE print ( noOfTriangles ( n ) ) NEW_LINE