Prime_factor function m vector kyu liye?

yahi kaam pair se bhi toh ho skta tha vector kyu liya ?
aur dono ways m kya difference hoga ??
aur kuch aisa h kya vector m size limit nhi dena hota jitna assign kiya utna print ho jayega ??

@anujsharmabadboy in this question you have to store the no and the cnt (times which it divides)
so sir stored in vector of pairs. you can use array of pairs too no issue. yes in vector its not compulsory to define size thats why it is considered above array for its dynamic property
hope its clear if yes dont forget to hit like and mark resolved :smiley:

@vatsal38 bhai
for(auto p:factor) isse vector print nhi ho rhaa

@anujsharmabadboy


corrected and commented

lekin sir ne toh for(auto p:factor) aur factor. krke likhvaya tha

@anujsharmabadboy it will also work just do this while displaying p.first and p.second

bhai m doubt resolve krne ka try kr rha hu lekin option hi nhi aa rha

@anujsharmabadboy np i will mark it resolved after a few days