{"ScriptPreparationCode":null,"TestCases":[{"Name":"Case 1","Code":"const hidePhone = (phone) =\u003E {\r\n const middle = Math.floor(phone.length / 2);\r\n const halfOfHidden = middle / 3;\r\n const startHidden = Math.floor(middle - halfOfHidden);\r\n const finishHidden = Math.ceil(middle \u002B halfOfHidden);\r\n\r\n return phone.substring(0, startHidden) \u002B \u0027*\u0027.repeat(finishHidden - startHidden) \u002B phone.substring(finishHidden);\r\n};\r\n\r\nhidePhone(\u0027375292222222\u0027);","IsDeferred":false},{"Name":"Case 2","Code":"const hidePhone = (phone) =\u003E {\r\n const middle = Math.floor(phone.length / 2);\r\n const halfOfHidden = middle / 3;\r\n const startHidden = middle - halfOfHidden;\r\n const finishHidden = middle \u002B halfOfHidden;\r\n\r\n return [...phone].reduce((acc, symbol, index) =\u003E {\r\n if (index \u003E= startHidden \u0026\u0026 index \u003C= finishHidden) return \u0060${acc}*\u0060;\r\n\r\n return \u0060${acc}${symbol}\u0060;\r\n }, \u0027\u0027);\r\n};\r\n\r\nhidePhone(\u0027375292222222\u0027);","IsDeferred":false}]}