Prime factorisation using sieve

what is the use of factors.clear( ) ???

@Ambuj-Singh-514796906079795 here we are defining a new vector every time so you can skip factor.clear() it won’t affect your code.