I'm working on factoring out of a nth root problem and I have started my code but am having trouble as it keeps segmentation faulting when I test it. Any help would be great. Thanks!
Also, line 38 should probably be varCount.push_back(count(factors.begin(), // ...
instead of varCount[i] = count(factors.begin(), // ...
since varCount initially has size 0 (and operator[] doesn't resize).