Special Keyboard Java
PROGRAM TO PRINT MAXIMUM NUMBER OF A'S USING GIVEN FOUR KEYS import java.io.*; class GFG { // A recursive function that returns // the optimal length string for N keystrokes static int findoptimal( int N) { // The optimal string length is N // when N is smaller than 7 if (N <= 6 ) return N; // Initialize result int max = 0 ; // TRY ALL POSSIBLE BREAK-POINTS // For any keystroke N, we need to ...
Comments
Post a Comment