Philaland Coin | TCS Mockvita 2020 | Python3 implementation to find the minimum number of denominations required for any number ; Function to find the minimum number of denomminations required ; Driver Code ; Function call
from math import log2 , floor NEW_LINE def findMinDenomin ( n ) : NEW_LINE INDENT return log2 ( n ) + 1 NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 10 NEW_LINE print ( floor ( findMinDenomin ( n ) ) ) NEW_LINE DEDENT