[JS] JavaScript 1 Liner (Short, with and without RegExp)
just for fun\n\nvar canFormArray = function(arr, pieces) {\n    return pieces.map(String).every((s) => new RegExp(`(^|,)${s}(,|$)`).test(arr.join()));\n};\n\nor
just for fun\n```\nvar canFormArray = function(arr, pieces) {\n    return pieces.map(String).every((s) => new RegExp(`(^|,)${s}(,|$)`).test(arr.join()));\n};\n```\nor use `reduce` (a bit worse)\n```\nvar canFormArray = function(arr, pieces) {\n    return pieces.map(String).reduce((a, b) => new RegExp(`(^|,)${b}(,|$)`).test(arr.join()) ? a && true : false, true);\n};\n```\nor remove the slow `RegExp`\n```\nvar canFormArray = function(arr, pieces) {\n    return pieces.every((p) => p.toString() === arr.slice(arr.indexOf(p[0]), arr.indexOf(p[0]) + p.length).toString());\n};\n```
[]