Well, passing -1 to unsigned int will make it max unsigned int, your
function will return the first freq, which in the scenario I gave, it would be the min freq, not the first max, right?