Simple & Easy Solution in Java


#1
public class Solution {
    public int gcd(int A, int B) {
        int div = A >= B ? A : B;
        while(true){
            if(A % div == 0 && B % div == 0){
                break;
            }
            div--;
        }
        return div;
    }
}