In Hogwarts there are N number of floors, each floor can be connected to up to N - 1 floors using the logic given below. 1 stair can connect only 2 floors together. Each floor has atleast one stair connecting it to another floor . A floor can be directly connected to multiple floors using different stairs, for example floor 1 can have 2 stairs, one connecting it to floor 2 and the other connecting it to floor 3. Given a floor as a starting point, find the least number of stairs used to reach a given final floor.
Share
Answer:
dlhsgksufsjgsfjsgskgskgsglshldysjfaitflux