SHARE
TWEET

Untitled

a guest Oct 21st, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function digitFibonacci(n) {
  2.   let a = 1;
  3.   let b = 1;
  4.   let i = 2;
  5.   while(('' + b).length < n){
  6.     [a, b] = [b, a+b];
  7.     i++
  8.   }
  9.  
  10.   // Good luck!
  11.   return i;
  12. }
  13.  
  14. digitFibonacci(20);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top