Skip to content

Instantly share code, notes, and snippets.

View balamark's full-sized avatar
🎯
Focusing

Mark balamark

🎯
Focusing
View GitHub Profile
@balamark
balamark / ProductOfDigits.cpp
Created November 14, 2017 02:06
first try. passed all except 999999937(TLE)
class ProductOfDigits {
public:
int smallestNumber(int N) {
vector<int> factors;
int n = N;
for(int i=2;i<=N;++i){
while(n%i==0){
factors.push_back(i);
n/=i;
}