[알고리즘문제풀기] 나이 출력

silver's avatar
Oct 24, 2025
[알고리즘문제풀기] 나이 출력

문제

내가 작성한 정답

class Solution { public int solution(int age) { return 2022-age+1; } }

다른 사람들의 정답

import java.time.*; class Solution { public int solution(int age) { LocalDate today = LocalDate.now(); return today.getYear() - age + 1; } }
Share article

silver