Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a8bb67 commit 5e3106eCopy full SHA for 5e3106e
1 file changed
Maths/CoPrimeCheck.js
@@ -9,8 +9,14 @@
9
is coprime with b.
10
*/
11
12
-// Here we require an already implemented method.
13
-const GetEuclidGCD = require('./GetEuclidGCD')
+// Here we use a GetEuclidGCD method as a utility.
+const GetEuclidGCD = (arg1, arg2) => {
14
+ let less = arg1 > arg2 ? arg2 : arg1
15
+ for (less; less >= 2; less--) {
16
+ if ((arg1 % less === 0) && (arg2 % less === 0)) return (less)
17
+ }
18
+ return (less)
19
+}
20
21
// CoPrimeCheck function return the boolean in respect of the given number is co-prime or not.
22
/**
0 commit comments