4 kyu
Multiply to `n`
155 of 164tonylicoding
Description:
Task
Given a positive integer, n
, return the number of possible ways such that k
positive integers multiply to n
. Order matters.
Examples
n = 24
k = 2
(1, 24), (2, 12), (3, 8), (4, 6), (6, 4), (8, 3), (12, 2), (24, 1) -> 8
n = 100
k = 1
100 -> 1
n = 20
k = 3
(1, 1, 20), (1, 2, 10), (1, 4, 5), (1, 5, 4), (1, 10, 2), (1, 20, 1),
(2, 1, 10), (2, 2, 5), (2, 5, 2), (2, 10, 1), (4, 1, 5), (4, 5, 1),
(5, 1, 4), (5, 2, 2), (5, 4, 1), (10, 1, 2), (10, 2, 1), (20, 1, 1) -> 18
Constraints
1 <= n <= 1_000_000_000_000
and 1 <= k <= 1_000
Mathematics
Algebra
Performance
Algorithms
Similar Kata:
Stats:
Created | Jul 22, 2020 |
Published | Jul 22, 2020 |
Warriors Trained | 2347 |
Total Skips | 110 |
Total Code Submissions | 2695 |
Total Times Completed | 164 |
Python Completions | 155 |
JavaScript Completions | 13 |
Total Stars | 138 |
% of votes with a positive feedback rating | 92% of 43 |
Total "Very Satisfied" Votes | 37 |
Total "Somewhat Satisfied" Votes | 5 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 5 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 7 kyu |