Last active
June 19, 2017 02:12
-
-
Save OneCent01/472c8ee0e07b7cbf47a250ce7bbdb0a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDivisible = function(n, c) { | |
if(n < 0) { | |
return isDivisible(-n, c); | |
} | |
if(n > 0 && n < c) { | |
return false; | |
} | |
if(n === 0) { | |
return true; | |
} | |
return isDivisible(n - c, c); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment