Created
August 12, 2019 22:22
-
-
Save sbuggay/cb40dc896e3cdaad707b7040ba9d5c03 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vector<int> factorize(int num) { | |
| vector<int> output; | |
| int i = 2; | |
| while (num > 1) { | |
| if (num % i == 0) { | |
| output.push_back(i); | |
| num = num / i; | |
| } | |
| else { | |
| i++; | |
| } | |
| } | |
| return output; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment