{"ScriptPreparationCode":"var array = [\r\n [1, 1, null, null, null, null],\r\n [1, null, null, 1, 1, null],\r\n [null, null, 1, 1, null, null, null],\r\n [1, 1, 1, 1, null, null]\r\n];","TestCases":[{"Name":"ForEach","Code":"const rightMostPosition = {x: 0, y: 0};\r\narray.forEach((element, yIndex) =\u003E {\r\n\tconst xIndex = element.reduceRight(\r\n\t\t(result, current, index) =\u003E\r\n\t\t\tresult ?? (current \u0026\u0026 index)\r\n\t);\r\n\tif (xIndex \u003E rightMostPosition.x) {\r\n\t\trightMostPosition.x = xIndex;\r\n\t\trightMostPosition.y = yIndex;\r\n\t}\r\n});","IsDeferred":false},{"Name":"Reduce","Code":"const rightMostPosition = array.reduce((position, currentArray, yIndex) =\u003E {\r\n\tconst xIndex = currentArray.reduceRight(\r\n\t\t(result, currentBlock, index) =\u003E\r\n\t\t\tresult ?? (currentBlock \u0026\u0026 index)\r\n\t);\r\n\tif (position.x \u003C xIndex) {\r\n\t\tposition.x = xIndex;\r\n\t\tposition.y = yIndex;\r\n\t}\r\n\treturn position;\r\n}, {x: 0, y: 0});","IsDeferred":false}]}