3.6 KiB
3.6 KiB
id | title | isRequired | challengeType | videoUrl | localeTitle |
---|---|---|---|---|---|
af2170cad53daa0770fabdea | Mutations | true | 5 | الطفرات |
Description
["hello", "Hello"]
، true لأن كافة الأحرف الموجودة في السلسلة الثانية موجودة في الحالة الأولى ، مع تجاهل الحالة. يجب أن ترجع الوسيطة ["hello", "hey"]
false لأن السلسلة "hello" لا تحتوي على "y". وأخيرًا ، يجب أن تعود ["Alien", "line"]
، إلى true لأن جميع الأحرف في "line" موجودة في "Alien". تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك. Instructions
Tests
tests:
- text: 'يجب أن تعود <code>mutation(["hello", "hey"])</code> false.'
testString: 'assert(mutation(["hello", "hey"]) === false, "<code>mutation(["hello", "hey"])</code> should return false.");'
- text: 'يجب أن تعود <code>mutation(["hello", "Hello"])</code> true.'
testString: 'assert(mutation(["hello", "Hello"]) === true, "<code>mutation(["hello", "Hello"])</code> should return true.");'
- text: 'يجب أن ترجع <code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> صحيح.'
testString: 'assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, "<code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code> should return true.");'
- text: 'يجب أن تعود <code>mutation(["Mary", "Army"])</code> الحقيقة.'
testString: 'assert(mutation(["Mary", "Army"]) === true, "<code>mutation(["Mary", "Army"])</code> should return true.");'
- text: 'يجب أن تعود <code>mutation(["Mary", "Aarmy"])</code> true.'
testString: 'assert(mutation(["Mary", "Aarmy"]) === true, "<code>mutation(["Mary", "Aarmy"])</code> should return true.");'
- text: 'يجب أن تعود <code>mutation(["Alien", "line"])</code> true.'
testString: 'assert(mutation(["Alien", "line"]) === true, "<code>mutation(["Alien", "line"])</code> should return true.");'
- text: 'يجب أن تعود <code>mutation(["floor", "for"])</code> true.'
testString: 'assert(mutation(["floor", "for"]) === true, "<code>mutation(["floor", "for"])</code> should return true.");'
- text: 'يجب أن تعود <code>mutation(["hello", "neo"])</code> false.'
testString: 'assert(mutation(["hello", "neo"]) === false, "<code>mutation(["hello", "neo"])</code> should return false.");'
- text: 'يجب أن تعود <code>mutation(["voodoo", "no"])</code> كاذبة.'
testString: 'assert(mutation(["voodoo", "no"]) === false, "<code>mutation(["voodoo", "no"])</code> should return false.");'
Challenge Seed
function mutation(arr) {
return arr;
}
mutation(["hello", "hey"]);
Solution
// solution required