Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 2.76 KB

68-is-n-divisible-by-(...).md

File metadata and controls

16 lines (15 loc) · 2.76 KB

Problem:

Create a function isDivisible(n,...) that checks if the first agrument n is divisible by all other arguments (return true if no other arguments)

Example:

isDivisible(6,1,3)--> true because 6 is divisible by 1 and 3
isDivisible(12,2)--> true because 12 is divisible by 2
isDivisible(100,5,4,10,25,20)--> true
isDivisible(12,7)--> false because 12 is not divisible by 7
isDivisible   3 [1,3]          `shouldBe` True
isDivisible  12 [2]            `shouldBe` True
isDivisible 100 [5,4,10,25,20] `shouldBe` True
isDivisible  12 [7]            `shouldBe` False
Assert.AreEqual(false, Kata.IsDivisible(3,3,4));
Assert.AreEqual(true, Kata.IsDivisible(12, 3, 4));

This kata is following kata: http://www.codewars.com/kata/is-n-divisible-by-x-and-y

Solution