[LeetCode] 509. Fibonacci Number (JAVA)
·
코딩테스트
leetcode.com/problems/fibonacci-number/ Fibonacci Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 일반적인 재귀함수 풀이 (= 내 풀이) public int fib(int n) { int result = 0; //1. if문으로 했을 때 if(n==0){ result=0; }else if(n==1){ result=1; }else{ result=fib(n-1)+fib(n-2); } //2. switch문 swi..