Added pairwise bonfire
parent
2d40779a96
commit
2c27d6d965
|
@ -483,6 +483,23 @@
|
|||
"expect(binaryAgent('01001001 00100000 01101100 01101111 01110110 01100101 00100000 01000110 01110010 01100101 01100101 01000011 01101111 01100100 01100101 01000011 01100001 01101101 01110000 00100001')).to.equal(\"I love FreeCodeCamp!\");"
|
||||
]
|
||||
},
|
||||
{
|
||||
"_id" : "a3f503de51cfab748ff001aa",
|
||||
"name": "Pairwise",
|
||||
"difficulty": "2.16",
|
||||
"description": [
|
||||
"Return the sum of all the indexes of elements that can be added to another element of the first array and equal the target provided in the second argument",
|
||||
"For example, pairwise([1,4,2,3,0,5], 5) should return 15 because every element can be paired with another element to equal 5.",
|
||||
"pairwise([1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!",
|
||||
"Once an element has been used it cannot be reused to pair with another."
|
||||
],
|
||||
"challengeSeed": "function pairwise(arr, arg) {\n return arg;\n}\n\npairwise([1,4,2,3,0,5], 5);",
|
||||
"tests": [
|
||||
"expect(pairwise([1,4,2,3,0,5], 5)).to.equal(15);",
|
||||
"expect(pairwise([1, 3, 2, 4], 4])).to.equal(1);",
|
||||
"expect(pairwise([0, 0, 0, 0, 1, 1])).to.equal(10);"
|
||||
]
|
||||
},
|
||||
{
|
||||
"_id": "a3f503de51cf954ede28891d",
|
||||
"name": "Symmetric Difference",
|
||||
|
|
Loading…
Reference in New Issue