{"ScriptPreparationCode":"function successiveRatios(arr = []) {\r\n return arr.reduce((ret, item, i) =\u003E {\r\n if (i \u002B 1 \u003E= arr.length) return ret;\r\n let successiveRatio;\r\n\r\n if(arr[i] === 0) {\r\n successiveRatio = 0\r\n } else {\r\n successiveRatio = arr[i \u002B 1] / arr[i];\r\n }\r\n\r\n return [...ret, successiveRatio];\r\n }, []);\r\n}\r\n\r\nfunction successiveRatios2(arr = []) {\r\n const ret = [];\r\n\r\n \tfor(let i=0; i\u003Carr.length - 1; i\u002B\u002B) {\r\n if(arr[i] === 0) {\r\n ret.push(0);\r\n } else {\r\n ret.push(arr[i \u002B 1] / arr[i]);\r\n }\r\n }\r\n\r\n \treturn ret;\r\n}","TestCases":[{"Name":"1","Code":"successiveRatios([1, 2, 3, 4]);","IsDeferred":false},{"Name":"2","Code":"successiveRatios2([1, 2, 3, 4]);","IsDeferred":false}]}