From 1ef24451639eaaf8496b767d4975279caabfd9ce Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Wed, 20 Dec 2017 19:29:42 +0530 Subject: [PATCH] indent the code correctly --- snippets/gcdOfArray.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/gcdOfArray.md b/snippets/gcdOfArray.md index dde3bfd08..33e671aba 100644 --- a/snippets/gcdOfArray.md +++ b/snippets/gcdOfArray.md @@ -1,10 +1,10 @@ + ### gcdOfArray -It finds the GCD of all the numbers in an array by using `array.reduce` and the fact that `gcd(a,b,c) = gcd(gcd(a,b),c)` +It finds the GCD of all the numbers in an array by using `Array.reduce()` and the fact that `gcd(a,b,c) = gcd(gcd(a,b),c)` ```js -const gcdOfArray = arr => - { +const gcdOfArray = arr =>{ const gcd = (x, y) => !y ? x : gcd(y, x % y); return arr.reduce((a,b) => gcd(a,b)) }