fork download
  1. import math
  2. from decimal import Decimal
  3.  
  4. def largest_common_power_of_10(numbers):
  5. return Decimal(math.gcd(*numbers)).normalize().as_tuple().exponent
  6.  
  7. print(largest_common_power_of_10([1234, 5000, 200]))
  8. print(largest_common_power_of_10([470_363_000, 143_539_000, 1_200_000]))
  9. print(largest_common_power_of_10([11_230_000, 1_540_000, 44_500_000]))
Success #stdin #stdout 0.03s 10396KB
stdin
Standard input is empty
stdout
0
3
4