class Solution {
public int solution(int age) {
int year = 2022;
int answer = 0;
if (age > 0 || age <= 120){
answer = year - age + 1;
}
return answer;
}
}
import java.time.*;
class Solution {
public int solution(int age) {
LocalDate today = LocalDate.now();
return today.getYear() - age + 1;
}
}