{"ScriptPreparationCode":"\tfunction Custom(iterable = null) {\r\n\t\tif (iterable !== null) {\r\n\t\t\tthis.array = Array.from(iterable);\r\n\t\t} else {\r\n\t\t\tthis.array = [];\r\n\t\t}\r\n \tthis.length = this.array.length;\r\n\t\tthis.index0 = 0;\r\n\t}\r\n\tCustom.prototype.item = function (accessor) {\r\n\t\treturn this.array[this.index0 \u002B Number(accessor)];\r\n\t};\r\n\tCustom.prototype.set = function (index, value) {\r\n\t\tconst newIndex = this.index0 \u002B Number(index);\r\n\t\tif (newIndex \u003E= this.length) {\r\n\t\t\tthis.length = newIndex \u002B 1;\r\n\t\t}\r\n\t\tthis.array[newIndex] = value;\r\n\t};\r\n\tCustom.prototype.shift = function () {\r\n\t\tif (this.length !== 0) {\r\n\t\t\tthis.length--;\r\n\t\t\tthis.index0\u002B\u002B;\r\n\t\t\treturn this.array[this.index0 - 1];\r\n\t\t}\r\n\t\treturn undefined;\r\n\t};\r\n\tCustom.prototype.pop = function () {\r\n\t\tif (this.length !== 0) {\r\n\t\t\tthis.length--;\r\n\t\t\treturn this.array[this.index0 \u002B this.length];\r\n\t\t}\r\n\t\treturn undefined;\r\n\t};\r\n\tCustom.prototype.push = function (value) {\r\n\t\tthis.array[this.index0 \u002B this.length] = value;\r\n\t\tthis.length\u002B\u002B;\r\n\t};\r\nfunction p(array) {\r\n for (var i = 0; i \u003C= 10000000; i\u002B\u002B) {\r\n array[array.length] = i;\r\n }\r\nreturn array;\r\n}\r\nvar a1 = p([]);\r\nvar a2 = p([]);\r\nvar q = new Custom(p(p(p(p(p([]))))));\r\nvar s = new Custom(p(p(p(p(p([]))))));","TestCases":[{"Name":"Array Shift","Code":"a1.shift();","IsDeferred":false},{"Name":"Array Pop","Code":"a2.pop();","IsDeferred":false},{"Name":"Custom Shift","Code":"q.shift();","IsDeferred":false},{"Name":"Custom Pop","Code":"s.pop();","IsDeferred":false}]}