{"ScriptPreparationCode":"function gcd(a, b){\r\n var divisor = 2, \r\n greatestDivisor = 1;\r\n\r\n if (a \u003C 2 || b \u003C 2)\r\n return 1;\r\n \r\n while(a \u003E= divisor \u0026\u0026 b \u003E= divisor){\r\n if(a %divisor == 0 \u0026\u0026 b% divisor ==0){\r\n greatestDivisor = divisor; \r\n }\r\n divisor\u002B\u002B;\r\n }\r\n return greatestDivisor;\r\n}\r\n\r\nfunction gcd1(a,b){\r\n var divisor = a \u003C b ? a : b; \t\r\n \r\n if(a \u003C 2 || b \u003C 2){\r\n return 1;\r\n }\r\n \r\n while(divisor \u003E 0){\r\n if(a % divisor === 0 \u0026\u0026 b % divisor === 0){\r\n return divisor;\r\n }\r\n divisor--;\r\n }\r\n}\r\n\r\nfunction gcd2(a, b){\r\n var x;\r\n \r\n while(b !== 0){\r\n x = a % b;\r\n a = b;\r\n b = x;\r\n }\r\n \r\n return a;\r\n}\r\n\r\nfunction gcd3(a, b){\r\n if(b === 0)\r\n return a;\r\n return gcd3(b, a % b);\r\n}\r\n\r\n","TestCases":[{"Name":"Original","Code":"gcd(1012, 10580);","IsDeferred":false},{"Name":"Improvement","Code":"gcd1(1012, 10580);","IsDeferred":false},{"Name":"Recursion","Code":"gcd3(1012, 10580);","IsDeferred":false},{"Name":"Reverse Engineered Recursion","Code":"gcd2(1012, 10580);","IsDeferred":false}]}