Expedia Group interview question

How to implement greatest common denominator.