class Solution {
public List<String> simplifiedFractions(int n) {
List<String> list = new ArrayList<>();
for (int i = 1; i <= n; i++) {
for (int j = i+1; j <=n ; j++) {
if (gcd(i,j)==1){
list.add(i+"/"+j);
}
}
}
return list;
}
int gcd(int a, int b){
if (b==0){
return a;
}
return gcd(b,a%b);
}
}
class Solution {
public int countPrimes(int n) {
if (n<2){
return 0;
}
if (n==2){
return 0;
}
List<Integer> list = new ArrayList<>();
list.add(2);
boolean isPrimes = true;
for (int i = 3; i < n ; i++) {
isPrimes = true;
for(int num : list){
if (i % num == 0){
isPrimes = false;
break;
}
}
if (isPrimes){
list.add(i);
}
}
return list.size();
}
}