개발일기/TIL(Since24.04.19)
Java&Spring -TIL(24.07.08 월)
w.llama
2024. 7. 8. 20:51
오늘 한 일
- Spring JPA 과제 피드백
- HyperSkill 문풀
- 프로그래머스 문풀
- 피보나치(Java)
- 584. Find Customer Referee (SQL)
풀이
class Solution {
public int solution(int n) {
int answer = fibo(n);
System.out.println(answer);
return answer;
}
public int fibo(int n) {
int[] cache = new int[n+1];
cache[0] = 0;
cache[1] = 1;
for (int i=2; i<= n; i++){
cache[i] = (cache[i-1] + cache[i-2]) % 1234567;
}
return cache[n] % 1234567;
}
}
다음 주 할 일
Spring JPA 과제 재 제출
HyperSkill/프로그래머스 문풀