M Factors of N
Problem
/**
* Return an array of m length arrays that are factors of n
*
* Each nested array should should be equal to n when the
* elements of the array are multiplied.
*/
function mFactorsOfN(n, m) {
// Your code
}
Example
For n = 12 and m = 3, mFactorsOfN should be:
[
[1, 1, 12],
[1, 2, 6],
[1, 3, 4],
[2, 2, 3]
]