Hello! You could simply add a variable which stores the current number with most factors.
On next iteration, if new number has same or more factors than previous "most factors" one, assign new number to the "most factors" variable. That way you don't even need to worry about the highest number, if there are more with same (highest) number of factors.
It will take some rearranging of your code, but you pretty much have all you need already coded.
On next iteration, if new number has same or more factors than previous "most factors" one, assign new number to the "most factors" variable. That way you don't even need to worry about the highest number, if there are more with same (highest) number of factors.
It will take some rearranging of your code, but you pretty much have all you need already coded.