Solución
solution.tsTypeScript
public class Solution {
public int[] goldbachPair(int n) {
int[] cousinNumbers = new int[]{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
for(int i = 0; i <cousinNumbers.length ;i++) {
int firstElement = cousinNumbers[i];
for(int j = 0; j < cousinNumbers.length; j++) {
int subsecuent = cousinNumbers[j];
if((firstElement + subsecuent) == n) {
return new int[]{firstElement, subsecuent};
}
}
}
return null;
}
}0respuestas