Count the minimum steps to reach 0 from the given integer N | Java program to count the minimum steps to reach 0 from the given integer N ; Function returns min step to reach 0 from N ; Direct possible reduction of value N ; Remaining steps needs to be reduced by 1 ; Summation of both the values ; Return the final answer ; Driver code
class GFG { static int getMinSteps ( int n , int jump ) { int quotient = n / jump ; int remainder = n % jump ; int steps = quotient + remainder ; return steps ; } public static void main ( String [ ] args ) { int N = 6 , K = 3 ; System . out . print ( getMinSteps ( N , K ) ) ; } }