7 kyu
Find the divisors!
39,880 of 89,134kwy95
Description:
Create a function named divisors
/Divisors
that takes an integer n > 1
and returns an array with all of the integer's divisors(except for 1 and the number itself), from smallest to largest. If the number is prime return the string '(integer) is prime' (null
in C#, empty table in COBOL) (use Either String a
in Haskell and Result<Vec<u32>, String>
in Rust).
Examples:
divisors(12) --> [2, 3, 4, 6]
divisors(25) --> [5]
divisors(13) --> "13 is prime"
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Oct 25, 2014 |
Published | Oct 25, 2014 |
Warriors Trained | 165016 |
Total Skips | 18530 |
Total Code Submissions | 288686 |
Total Times Completed | 89134 |
JavaScript Completions | 39880 |
CoffeeScript Completions | 160 |
Haskell Completions | 1200 |
Python Completions | 35192 |
Ruby Completions | 4218 |
Rust Completions | 1712 |
Elixir Completions | 300 |
C# Completions | 3075 |
PHP Completions | 3762 |
C Completions | 729 |
COBOL Completions | 9 |
Dart Completions | 65 |
Lua Completions | 33 |
TypeScript Completions | 111 |
Total Stars | 856 |
% of votes with a positive feedback rating | 89% of 8861 |
Total "Very Satisfied" Votes | 7148 |
Total "Somewhat Satisfied" Votes | 1562 |
Total "Not Satisfied" Votes | 151 |