{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using map\u002Breverse\u002Bjoin","Code":"\u0022112345678\u0022.split(\u0022\u0022).reverse().map((x,i)=\u003E{\r\n\tif((i \u002B 1) % 3 === 0){\r\n\t\t\treturn \u0022 \u0022\u002Bx;\r\n\t} else {\r\n\t\treturn x;\r\n\t}\r\n}).reverse().join(\u0022\u0022).trim();","IsDeferred":false},{"Name":"Using reduce","Code":"\u002212345678\u0022\r\n.split(\u0022\u0022)\r\n.reverse()\r\n.reduce((acc, cur, i) =\u003E\r\n\t(((i \u002B 1) % 3 === 0 ? \u0027 \u0027 : \u0027\u0027)\r\n\t\t\u002B cur \u002B acc)\r\n, \u0022\u0022).trim();","IsDeferred":false}]}