All Factors

Given a number N, find all factors of N.

Example:

N = 6 
factors = {1, 2, 3, 6}

Make sure the returned array is sorted.

Problem Approach:

Complete code in the hint.

Interview Code Editor
Hints
  • Complete Solution
7591 successful submissions.
Click here to jump start your coding interview preparation