Philaland Coin | TCS Mockvita 2020 | Java 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
import java . io . * ; class GFG { static int findMinDenomin ( int n ) { return ( ( int ) ( Math . log ( n ) / Math . log ( 2 ) ) + 1 ) ; } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( findMinDenomin ( n ) ) ; } }