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
def getMinSteps ( n , jump ) : NEW_LINE INDENT quotient = int ( n / jump ) NEW_LINE remainder = n % jump NEW_LINE steps = quotient + remainder NEW_LINE return steps NEW_LINE DEDENT N = 6 NEW_LINE K = 3 NEW_LINE print ( getMinSteps ( N , K ) ) NEW_LINE