class Solution { public int[] solution(int n, int m) { int[] answer = new int[2]; // Swap n and m if n is greater than m if (n > m) { int temp = n; n = m; m = temp; } // Calculate GCD using Euclidean algorithm int gcd = gcd(n, m); // Calculate LCM using the relation LCM(a, b) = a * b / GC..