7 kyu
Find factors of a number
901 of 2,143zCo
Description:
Create a function that takes a number and finds the factors of it, listing them in descending order in an array.
If the parameter is not an integer or less than 1, return -1
. In C# return an empty array.
For Example:
factors(54)
should return [54, 27, 18, 9, 6, 3, 2, 1]
Sorting
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Nov 20, 2015 |
Published | Nov 20, 2015 |
Warriors Trained | 3446 |
Total Skips | 160 |
Total Code Submissions | 9215 |
Total Times Completed | 2143 |
JavaScript Completions | 832 |
Python Completions | 901 |
Ruby Completions | 159 |
CoffeeScript Completions | 14 |
C# Completions | 330 |
Total Stars | 31 |
% of votes with a positive feedback rating | 89% of 310 |
Total "Very Satisfied" Votes | 253 |
Total "Somewhat Satisfied" Votes | 45 |
Total "Not Satisfied" Votes | 12 |