Maximize count of strings of length 3 that can be formed from N 1 s and M 0 s | Java program for the above approach ; Function that counts the number of Strings of length 3 that can be made with given m 0 s and n 1 s ; Print the count of Strings ; Driver Code ; Given count of 1 s and 0 s ; Function Call
class GFG { static void number_of_Strings ( int N , int M ) { System . out . print ( Math . min ( N , Math . min ( M , ( N + M ) / 3 ) ) ) ; } public static void main ( String [ ] args ) { int N = 4 , M = 19 ; number_of_Strings ( N , M ) ; } }