Factor Combinations
Medium · Backtracking · about 20 minutes
Asked at LinkedIn, Uber, Amazon, Google.
Return all ways to write n as a product of factors in [2, n - 1] (so n itself isn't a factorization). Each combination is listed once with factors in non-decreasing order; the combinations may be in any order.