problem statement
You are given two natural numbers. Imagine these natural numbers as nodes on a graph. On this graph, a number is connected to its largest factor other than itself. You have to find the shortest path between them and print the number of edges on that path.
If the two numbers do not have any common factor, then construct a path through 1. For better understanding refer to the examples below:
input : 2 4 output : 1
input: 9 9 output : 0
input 28 100 output: 7
input: 18 19 output: 4
This problem can be solved without reading problem statement, can write code, simply checking examples / test cases