Count cubes of size K inscribed in a cube of size N | Function to find the number of the cubes of the size K ; Stores the number of cubes ; Stores the number of cubes of size k ; Size of the bigger cube ; Size of the smaller cube
def No_of_cubes ( N , K ) : NEW_LINE INDENT No = 0 NEW_LINE No = ( N - K + 1 ) NEW_LINE No = pow ( No , 3 ) NEW_LINE return No NEW_LINE DEDENT N = 5 NEW_LINE K = 2 NEW_LINE print ( No_of_cubes ( N , K ) ) NEW_LINE