Can someone find the bug in the code


#1

public class Solution {
public ArrayList primesum(int A) {
ArrayList primeList = new ArrayList<>();
for(int j=2;j<A;j++) {
if(isPrime(j)){
primeList.add(j);
}
else{
continue;
}
int x = A-j;
if(isPrime(x)){
primeList.add(x);
break;
}
else{
primeList.clear();
}
}
return primeList;
}
public boolean isPrime(int n) {
int count=0;
for(int i=2;i<n;i++){
if(n%i==0){
count++;
}
if(count==0){
return true;
}
else{
return false;
}
}
}


#2

I think you have missed a closed curly braces for the isPrime()- for loop.
Hope it helps you. Thank you