"For this challenge you will be presented with a string such as \"800-692-7753\" or \"8oo-six427676;laskdjf\". Your job is to validate or reject the US phone number based on any combination of the formats provided above. The area code is required. If the country code is provided, you must confirm that the country code is \"1\". Return true if the string is a valid US phone number; otherwise false.",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
"Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.",
"The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
"assert.deepEqual(sym([1, 1]), [1], 'should return an array of unique values');"
],
"MDNlinks":[
"Array.reduce()",
"Symmetric Difference"
],
"challengeType":5,
"nameCn":"",
"descriptionCn":[],
"nameFr":"",
"descriptionFr":[],
"nameRu":"",
"descriptionRu":[],
"nameEs":"",
"descriptionEs":[],
"namePt":"",
"descriptionPt":[]
},
{
"id":"aa2e6f85cab2ab736c9a9b24",
"name":"Bonfire: Exact Change",
"dashedName":"bonfire-exact-change",
"difficulty":"4.03",
"description":[
"Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.",
"cid is a 2d array listing available currency.",
"Return the string \"Insufficient Funds\" if cash-in-drawer is less than the change due. Return the string \"Closed\" if cash-in-drawer is equal to the change due.",
"Otherwise, return change in coin and bills, sorted in highest to lowest order.",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
"Compare and update inventory stored in a 2d array against a second 2d array of a fresh delivery. Update current inventory item quantity, and if an item cannot be found, add the new item and quantity into the inventory array in alphabetical order.",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
],
"challengeSeed":[
"function inventory(arr1, arr2) {",
" // All inventory must be accounted for or you're fired!",
"Return the number of total permutations of the provided string that don't have repeated consecutive letters.",
"For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
],
"challengeSeed":[
"function permAlone(str) {",
" return str;",
"}",
"",
"permAlone('aab');"
],
"tests":[
"expect(permAlone('aab')).to.be.a('number');",
"expect(permAlone('aab')).to.equal(2);",
"expect(permAlone('aaa')).to.equal(0);",
"expect(permAlone('aabb')).to.equal(8);",
"expect(permAlone('abcdefa')).to.equal(3600);",
"expect(permAlone('abfdefa')).to.equal(2640);",
"expect(permAlone('zzzzzzzz')).to.equal(0);"
],
"MDNlinks":[
"Permutations",
"RegExp"
],
"challengeType":5,
"nameCn":"",
"descriptionCn":[],
"nameFr":"",
"descriptionFr":[],
"nameRu":"",
"descriptionRu":[],
"nameEs":"",
"descriptionEs":[],
"namePt":"",
"descriptionPt":[]
},
{
"id":"a19f0fbe1872186acd434d5a",
"name":"Bonfire: Friendly Date Ranges",
"dashedName":"bonfire-friendly-date-ranges",
"difficulty":"4.06",
"description":[
"Implement a way of converting two dates into a more friendly date range that could be presented to a user.",
"It must not show any redundant information in the date range.",
"For example, if the year and month are the same then only the day range should be displayed.",
"Secondly, if the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted.",
"Input date is formatted as YYYY-MM-DD",
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>RSAP</a> if you get stuck. Try to pair program. Write your own code."
],
"challengeSeed":[
"function friendly(str) {",
" return str;",
"}",
"",
"friendly(['2015-07-01', '2015-07-04']);"
],
"tests":[
"assert.deepEqual(friendly(['2015-07-01', '2015-07-04']), ['July 1st','4th'], 'ending month should be omitted since it is already mentioned');",
"assert.deepEqual(friendly(['2015-12-01', '2016-02-03']), ['December 1st','February 3rd'], 'two months apart can be inferred if it is the next year');",