Try   HackMD

509. Fibonacci Number

本題主要考驗將資料 費波那契數 用法

Rearrange Products Table

透過leetcode 509Fibonacci Number來練習

題目說明:

斐波那契數列通常表示F(n)為一個數列,稱為斐波那契數列,其中每個數都是前兩個數的和,從0和開始1。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

題目:
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

解題:

var fib = function(n) { if(n === 0) return 0 if(n === 1) return 1 return fib(n-1)+fib(n-2); };

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →