{"ScriptPreparationCode":"function equivalent(arr1, arr2) {\r\n if (arr1.length !== arr2.length) {\r\n return false\r\n }\r\n arr1.forEach((elem) =\u003E {\r\n const index = arr2.findIndex((elem2) =\u003E elem === elem2)\r\n if (index === -1) { // not found\r\n return false\r\n }\r\n arr2.splice(index, 1) // remove element\r\n })\r\n if (arr2.length \u003E 0) { // if still values in arr2, they are not in arr1\r\n return false\r\n }\r\n return true\r\n}","TestCases":[{"Name":"little pyramid","Code":"const res = equivalent([1, 2, 3, 4, 5], [5, 4, 3, 2, 1])\r\nconsole.log(res)","IsDeferred":false},{"Name":"big pyramid","Code":"const array1 = []\r\nconst array2 = []\r\nfor (let i = 0; i \u003C= 100; i\u002B\u002B) {\r\n array1.push(i)\r\n}\r\nfor (let i = 99; i \u003E= 0; i--) {\r\n array1.push(i)\r\n}\r\n\r\nconst res = equivalent(array1, array2)\r\nconsole.log(res)","IsDeferred":false}]}