2020-10-06 23:10:08 +05:30

1.7 KiB
Raw Blame History

id, challengeType, videoUrl, localeTitle
id challengeType videoUrl localeTitle
5992e222d397f00d21122931 5 斐波那契字

Description

编写一个函数将Fibonacci字返回到N.N将作为参数提供给函数。该函数应返回一个对象数组。对象的形式应为{N1长度10单词'1'}。更多细节如下:

Fibonacci Word可以类似于Fibonacci Sequence的方式创建 如下所述

将F_Word 1定义为1

将F_Word 2定义为0

将F_Word 3表示为F_Word 2与F_Word 1连接01

将F_Word n表示为F_Word n-1与F_word n-2连接

Instructions

Tests

tests:
  - text: <code>fibWord</code>是一个功能。
    testString: assert(typeof fibWord === 'function');
  - text: <code>fibWord(5)</code>应该返回一个数组。
    testString: assert(Array.isArray(fibWord(5)));
  - text: '<code>fibWord(5)</code>应该返回<code>&#39;+JSON.stringify(ans)+&#39;</code> 。'
    testString: assert.deepEqual(fibWord(5),ans);

Challenge Seed

function fibWord (n) {
  // Good luck!
}

After Test

console.info('after the test');

Solution

// solution required

/section>