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

2.3 KiB
Raw Blame History

id, challengeType, videoUrl, title
id challengeType videoUrl title
594810f028c0303b75339acc 5 ABC问题

Description

您将获得ABC块的集合例如童年字母块。每个街区有20个街区两个字母。块的所有侧面都保证有完整的字母表。块的样本集合

BO

XK

DQ

CP

NA

GT

(回覆)

TG

QD

FS

JW

HU

VI

(一个)

OB

ER

FS

LY

PC

ZM

要记住一些规则:

一旦使用了块上的字母,就不能再使用该块。该函数应该不区分大小写。

实现一个带字符串(单词)的函数,并确定该单词是否可以与给定的块集合拼写。

Instructions

Tests

tests:
  - text: <code>canMakeWord</code>是一个功能。
    testString: assert(typeof canMakeWord === 'function');
  - text: <code>canMakeWord</code>应该返回一个布尔值。
    testString: assert(typeof canMakeWord('hi') === 'boolean');
  - text: <code>canMakeWord(&quot;bark&quot;)</code>应该返回true。
    testString: assert(canMakeWord(words[0]));
  - text: <code>canMakeWord(&quot;BooK&quot;)</code>应该返回false。
    testString: assert(!canMakeWord(words[1]));
  - text: <code>canMakeWord(&quot;TReAT&quot;)</code>应该返回true。
    testString: assert(canMakeWord(words[2]));
  - text: <code>canMakeWord(&quot;COMMON&quot;)</code>应返回false。
    testString: assert(!canMakeWord(words[3]));
  - text: <code>canMakeWord(&quot;squAD&quot;)</code>应该返回true。
    testString: assert(canMakeWord(words[4]));
  - text: <code>canMakeWord(&quot;conFUSE&quot;)</code>应该返回true。
    testString: assert(canMakeWord(words[5]));

Challenge Seed

function canMakeWord (word) {
  // Good luck!
}

After Test

console.info('after the test');

Solution

// solution required

/section>