Factor combinations

Write codeMedium25 min

Your task

Given an integer n (n >= 1), return all combinations of its factors, each greater than 1, whose product equals n. Each combination must be in non-decreasing order, and you should not include the trivial single-factor combination [n] itself. Return the list of combinations sorted lexicographically. n is at most 100000.

Examples

get_factors(n: int) -> list[list[int]]
Example 1
Inputget_factors(12)
Output[[2, 2, 3], [2, 6], [3, 4]]