Skip to content

Latest commit

 

History

History

Minimum Number of Jumps to Reach ( M , N ) From ( 1 , 1 )

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Find Minimum Jumps to reach ( M , N ) from ( 1, 1 ). If you are at ( X , Y ), then you can go to either ( X + Y , Y) or ( X , X + Y ). If it's not possible to reach ( M , N ), then return -1.

      M = 3,  N = 2 
      output = 2
      
      
      M = 2, N = 2
      output = -1