Pergunta de entrevista da empresa Amazon

How would you find the common primes in two integers ?

Respostas da entrevista

Sigiloso

9 de fev. de 2012

Compute the GCD of the two numbers using Euclid's algorithm. Prime factorise the GCD.

2

Sigiloso

13 de mar. de 2012

GCD(int j, int i){ //assume i>j while(j!=0){ int temp=i%j; int i=j; int j=temp; } return i; }