{"ScriptPreparationCode":"var str = \u0022\uFF11\uFF15\uFF10\uFF17\uFF12\uFF11\u0022;\r\nvar DIGITS = new Map([\r\n [\u00220\u0022, \u00220\u0022],\r\n [\u00221\u0022, \u00221\u0022],\r\n [\u00222\u0022, \u00222\u0022],\r\n [\u00223\u0022, \u00223\u0022],\r\n [\u00224\u0022, \u00224\u0022],\r\n [\u00225\u0022, \u00225\u0022],\r\n [\u00226\u0022, \u00226\u0022],\r\n [\u00227\u0022, \u00227\u0022],\r\n [\u00228\u0022, \u00228\u0022],\r\n [\u00229\u0022, \u00229\u0022],\r\n [\u0022\\uFF10\u0022, \u00220\u0022], // Fullwidth digit 0\r\n [\u0022\\uFF11\u0022, \u00221\u0022], // Fullwidth digit 1\r\n [\u0022\\uFF12\u0022, \u00222\u0022], // Fullwidth digit 2\r\n [\u0022\\uFF13\u0022, \u00223\u0022], // Fullwidth digit 3\r\n [\u0022\\uFF14\u0022, \u00224\u0022], // Fullwidth digit 4\r\n [\u0022\\uFF15\u0022, \u00225\u0022], // Fullwidth digit 5\r\n [\u0022\\uFF16\u0022, \u00226\u0022], // Fullwidth digit 6\r\n [\u0022\\uFF17\u0022, \u00227\u0022], // Fullwidth digit 7\r\n [\u0022\\uFF18\u0022, \u00228\u0022], // Fullwidth digit 8\r\n [\u0022\\uFF19\u0022, \u00229\u0022], // Fullwidth digit 9\r\n [\u0022\\u0660\u0022, \u00220\u0022], // Arabic-indic digit 0\r\n [\u0022\\u0661\u0022, \u00221\u0022], // Arabic-indic digit 1\r\n [\u0022\\u0662\u0022, \u00222\u0022], // Arabic-indic digit 2\r\n [\u0022\\u0663\u0022, \u00223\u0022], // Arabic-indic digit 3\r\n [\u0022\\u0664\u0022, \u00224\u0022], // Arabic-indic digit 4\r\n [\u0022\\u0665\u0022, \u00225\u0022], // Arabic-indic digit 5\r\n [\u0022\\u0666\u0022, \u00226\u0022], // Arabic-indic digit 6\r\n [\u0022\\u0667\u0022, \u00227\u0022], // Arabic-indic digit 7\r\n [\u0022\\u0668\u0022, \u00228\u0022], // Arabic-indic digit 8\r\n [\u0022\\u0669\u0022, \u00229\u0022], // Arabic-indic digit 9\r\n [\u0022\\u06F0\u0022, \u00220\u0022], // Eastern-Arabic digit 0\r\n [\u0022\\u06F1\u0022, \u00221\u0022], // Eastern-Arabic digit 1\r\n [\u0022\\u06F2\u0022, \u00222\u0022], // Eastern-Arabic digit 2\r\n [\u0022\\u06F3\u0022, \u00223\u0022], // Eastern-Arabic digit 3\r\n [\u0022\\u06F4\u0022, \u00224\u0022], // Eastern-Arabic digit 4\r\n [\u0022\\u06F5\u0022, \u00225\u0022], // Eastern-Arabic digit 5\r\n [\u0022\\u06F6\u0022, \u00226\u0022], // Eastern-Arabic digit 6\r\n [\u0022\\u06F7\u0022, \u00227\u0022], // Eastern-Arabic digit 7\r\n [\u0022\\u06F8\u0022, \u00228\u0022], // Eastern-Arabic digit 8\r\n [\u0022\\u06F9\u0022, \u00229\u0022], // Eastern-Arabic digit 9\r\n]);\r\n\r\nvar DIGITz = {\r\n \u00220\u0022: \u00220\u0022,\r\n \u00221\u0022: \u00221\u0022,\r\n \u00222\u0022: \u00222\u0022,\r\n \u00223\u0022: \u00223\u0022,\r\n \u00224\u0022: \u00224\u0022,\r\n \u00225\u0022: \u00225\u0022,\r\n \u00226\u0022: \u00226\u0022,\r\n \u00227\u0022: \u00227\u0022,\r\n \u00228\u0022: \u00228\u0022,\r\n \u00229\u0022: \u00229\u0022,\r\n \u0022\\uFF10\u0022: \u00220\u0022, // Fullwidth digit 0\r\n \u0022\\uFF11\u0022: \u00221\u0022, // Fullwidth digit 1\r\n \u0022\\uFF12\u0022: \u00222\u0022, // Fullwidth digit 2\r\n \u0022\\uFF13\u0022: \u00223\u0022, // Fullwidth digit 3\r\n \u0022\\uFF14\u0022: \u00224\u0022, // Fullwidth digit 4\r\n \u0022\\uFF15\u0022: \u00225\u0022, // Fullwidth digit 5\r\n \u0022\\uFF16\u0022: \u00226\u0022, // Fullwidth digit 6\r\n \u0022\\uFF17\u0022: \u00227\u0022, // Fullwidth digit 7\r\n \u0022\\uFF18\u0022: \u00228\u0022, // Fullwidth digit 8\r\n \u0022\\uFF19\u0022: \u00229\u0022, // Fullwidth digit 9\r\n \u0022\\u0660\u0022: \u00220\u0022, // Arabic-indic digit 0\r\n \u0022\\u0661\u0022: \u00221\u0022, // Arabic-indic digit 1\r\n \u0022\\u0662\u0022: \u00222\u0022, // Arabic-indic digit 2\r\n \u0022\\u0663\u0022: \u00223\u0022, // Arabic-indic digit 3\r\n \u0022\\u0664\u0022: \u00224\u0022, // Arabic-indic digit 4\r\n \u0022\\u0665\u0022: \u00225\u0022, // Arabic-indic digit 5\r\n \u0022\\u0666\u0022: \u00226\u0022, // Arabic-indic digit 6\r\n \u0022\\u0667\u0022: \u00227\u0022, // Arabic-indic digit 7\r\n \u0022\\u0668\u0022: \u00228\u0022, // Arabic-indic digit 8\r\n \u0022\\u0669\u0022: \u00229\u0022, // Arabic-indic digit 9\r\n \u0022\\u06F0\u0022: \u00220\u0022, // Eastern-Arabic digit 0\r\n \u0022\\u06F1\u0022: \u00221\u0022, // Eastern-Arabic digit 1\r\n \u0022\\u06F2\u0022: \u00222\u0022, // Eastern-Arabic digit 2\r\n \u0022\\u06F3\u0022: \u00223\u0022, // Eastern-Arabic digit 3\r\n \u0022\\u06F4\u0022: \u00224\u0022, // Eastern-Arabic digit 4\r\n \u0022\\u06F5\u0022: \u00225\u0022, // Eastern-Arabic digit 5\r\n \u0022\\u06F6\u0022: \u00226\u0022, // Eastern-Arabic digit 6\r\n \u0022\\u06F7\u0022: \u00227\u0022, // Eastern-Arabic digit 7\r\n \u0022\\u06F8\u0022: \u00228\u0022, // Eastern-Arabic digit 8\r\n \u0022\\u06F9\u0022: \u00229\u0022, // Eastern-Arabic digit 9\r\n};","TestCases":[{"Name":"Map","Code":"let result = \u0027\u0027;\r\nfor (let i = 0, n = str.length; i \u003C n; \u002B\u002Bi) {\r\n result \u002B= DIGITS.get(str[i]);\r\n}","IsDeferred":false},{"Name":"one liner","Code":"str.normalize(\u0022NFKC\u0022).replace(/[\u0660-\u0669\u06F0-\u06F9]/g,a=\u003Ea.charCodeAt(0)\u002615);","IsDeferred":false},{"Name":"one liner swapped","Code":"str.replace(/[\u0660-\u0669\u06F0-\u06F9]/g,a=\u003Ea.charCodeAt(0)\u002615).normalize(\u0022NFKC\u0022);","IsDeferred":false},{"Name":"ES6 for loop","Code":"let result = \u0027\u0027;\r\nfor (let letter of str) {\r\n result \u002B= DIGITS.get(letter);\r\n}","IsDeferred":false},{"Name":"Using object","Code":"let result = \u0027\u0027;\r\nfor (let letter of str) {\r\n result \u002B= DIGITz[letter];\r\n}","IsDeferred":false},{"Name":"regex normalize","Code":"str.replace(/[\\uFF10-\\uFF19]/g,a=\u003Ea.charCodeAt(a.charCodeAt(0)-0xfee0)).replace(/[\u0660-\u0669\u06F0-\u06F9]/g,a=\u003Ea.charCodeAt(0)\u002615);","IsDeferred":false},{"Name":"regex normalize swapped","Code":"str.replace(/[\u0660-\u0669\u06F0-\u06F9]/g,a=\u003Ea.charCodeAt(0)\u002615).replace(/[\\uFF10-\\uFF19]/g,a=\u003Ea.charCodeAt(a.charCodeAt(0)-0xfee0));","IsDeferred":false}]}